diff --git a/Houseclub/src/main/java/me/grishka/houseclub/fragments/ProfileFragment.java b/Houseclub/src/main/java/me/grishka/houseclub/fragments/ProfileFragment.java
index e0ee265a..b9a7bd8a 100644
--- a/Houseclub/src/main/java/me/grishka/houseclub/fragments/ProfileFragment.java
+++ b/Houseclub/src/main/java/me/grishka/houseclub/fragments/ProfileFragment.java
@@ -21,6 +21,7 @@
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -42,8 +43,8 @@
import me.grishka.houseclub.api.methods.Me;
import me.grishka.houseclub.api.methods.Unfollow;
import me.grishka.houseclub.api.methods.UpdateBio;
-import me.grishka.houseclub.api.methods.UpdatePhoto;
import me.grishka.houseclub.api.methods.UpdateName;
+import me.grishka.houseclub.api.methods.UpdatePhoto;
import me.grishka.houseclub.api.model.FullUser;
public class ProfileFragment extends LoaderFragment{
@@ -54,17 +55,19 @@ public class ProfileFragment extends LoaderFragment{
private TextView name, username, followers, following, followsYou, bio, inviteInfo, twitter, instagram,
invites;
- private ImageView photo, inviterPhoto;
+ private ImageView photo, photo_edit_icon,inviterPhoto;
private Button followBtn, inviteButton;
private EditText invitePhoneNum;
private View socialButtons, inviteLayout;
private boolean self;
+
@Override
public void onAttach(Activity activity){
super.onAttach(activity);
loadData();
self=getArguments().getInt("id")==Integer.parseInt(ClubhouseSession.userID);
+ isImageFitToScreen=true;
if(self)
setHasOptionsMenu(true);
}
@@ -98,11 +101,16 @@ public View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bu
following.setOnClickListener(this::onFollowingClick);
v.findViewById(R.id.inviter_btn).setOnClickListener(this::onInviterClick);
if(self){
+ photo_edit_icon=v.findViewById(R.id.photo_edit_icon);
+ photo_edit_icon.setVisibility(View.VISIBLE);
bio.setOnClickListener(this::onBioClick);
photo.setOnClickListener(this::onPhotoClick);
name.setOnClickListener(this::onNameClick);
inviteButton.setOnClickListener(this::onInviteClick);
}
+ else {
+ photo.setOnClickListener(this::onForeignPhotoClick);
+ }
return v;
}
@@ -415,4 +423,15 @@ private void onPhotoClick(View v){
intent.setType("image/*");
startActivityForResult(intent, PICK_PHOTO_RESULT);
}
+ private void onForeignPhotoClick(View view) {
+ if(isImageFitToScreen) {
+ isImageFitToScreen=false;
+ photo.setLayoutParams(new LinearLayout.LayoutParams((int) (272 * (getResources().getDisplayMetrics().density)), (int) (272 * (getResources().getDisplayMetrics().density))));
+ photo.setAdjustViewBounds(true);
+ }else{
+ isImageFitToScreen=true;
+ photo.setLayoutParams(new LinearLayout.LayoutParams((int) (72 * (getResources().getDisplayMetrics().density)), (int) (72 * (getResources().getDisplayMetrics().density))));
+ photo.setScaleType(ImageView.ScaleType.FIT_XY);
+ }
+ }
}
diff --git a/Houseclub/src/main/res/drawable/ic_photo_camera.xml b/Houseclub/src/main/res/drawable/ic_photo_camera.xml
new file mode 100644
index 00000000..ed408f86
--- /dev/null
+++ b/Houseclub/src/main/res/drawable/ic_photo_camera.xml
@@ -0,0 +1,13 @@
+
+
+
+
diff --git a/Houseclub/src/main/res/layout/profile.xml b/Houseclub/src/main/res/layout/profile.xml
index ed9ae7a8..6e7b5af6 100644
--- a/Houseclub/src/main/res/layout/profile.xml
+++ b/Houseclub/src/main/res/layout/profile.xml
@@ -1,193 +1,210 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 90354c48..53a9a59e 100644
--- a/README.md
+++ b/README.md
@@ -11,11 +11,11 @@ Not to be taken seriously.
* Login
* Registration *should* work, but I suggest that you better use an iOS device to register
* Seeing the list of rooms however the server recommends them
-* Joining rooms from said list and by direct links
+* Joining rooms from the said list and by direct links
* Listening and speaking
* Raising hand (asking to speak)
* Accepting when a moderator allows you to speak
-* Real-time updates in to the participant list
+* Real-time updates into the participant list
* Profiles
* Following and unfollowing people
* Followers/following lists
@@ -24,13 +24,14 @@ Not to be taken seriously.
* Changing your name (but the official app says you can only do this once — not sure if there's a limitation on the server side)
* Notifications
-The rest isn't implemented. In particular you can't create and moderate rooms. There's probably a hundred bugs in the existing functionality too.
+The rest isn't implemented. In particular, there are no notifications, and you can't create and moderate rooms. There are probably a hundred bugs in the existing functionality too.
+
### Java? In %year%?! Why not Kotlin? Why are there no jetpack libraries? System fragments?!?! Are you out of your mind?
-Maybe I am. I use tools I'm most familiar with, not ones that are trendy at the particular day I'm starting the project.
+Maybe I am. I use tools I'm most familiar with, not ones that are trendy on a particular day I'm starting the project.
### The design...
-...sucks. Yes it does. See, this isn't meant to be a real product. I hastily put this together in 1.5 days. Alsmost like on a hackathon. This is more of a proof of concept, a stopgap measure before Clubhouse releases their official Android app that I'm sure they're making right now. It doesn't make sense to spend all this effort on something that's going to be obsolete in less than a year.
+...sucks. Yes, it does. See, this isn't meant to be a real product. I hastily put this together in 1.5 days. Almost like on a hackathon. This is more of a proof of concept, a stopgap measure before Clubhouse releases their official Android app that I'm sure they're making right now. It doesn't make sense to spend all this effort on something that's going to be obsolete in less than a year.
If you want to see a project where I do take UI/UX seriously and am obsessed over every little detail, go check out [Smithereen](https://github.com/grishka/Smithereen), the decentralized social media server.
@@ -38,7 +39,7 @@ If you want to see a project where I do take UI/UX seriously and am obsessed ove
The probability of that happening is not zero.
### Why did you make this?
-I saw that project with the Clubhouse API reverse engineersed and thought to myself *why not*. The only thing I had to reverse engineer myself was the PubNub part, but a pirated copy of Charles made a quick job of that.
+I saw that project with the Clubhouse API reverse engineered and thought to myself *why not*. The only thing I had to reverse engineer myself was the PubNub part, but a pirated copy of Charles made a quick job of that.
### How do I build this?
Import into Android Studio and click "run". Or, there's an apk you can install in the releases section.