Some changes

This commit is contained in:
tom79 2019-09-25 11:43:31 +02:00
parent 9087440a1d
commit 2f901d4e47
3 changed files with 16 additions and 6 deletions

View File

@ -89,6 +89,7 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
private EditText set_profile_name, set_profile_description;
private LinearLayout custom_fields_container;
private ImageView set_profile_picture, set_header_picture;
private Button set_change_profile_picture, set_change_header_picture, set_profile_save;
private TextView set_header_picture_overlay;
@ -159,8 +160,9 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
Account account = new AccountDAO(getApplicationContext(), db).getUniqAccount(userId, instance);
Helper.loadGiF(getApplicationContext(), account.getAvatar(), pp_actionBar);
Helper.loadGiF(getApplicationContext(), account.getAvatar(), pp_actionBar);
custom_fields_container = findViewById(R.id.custom_fields_container);
set_profile_name = findViewById(R.id.set_profile_name);
set_profile_description = findViewById(R.id.set_profile_description);
set_profile_picture = findViewById(R.id.set_profile_picture);
@ -182,6 +184,10 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
set_sensitive_content.setVisibility(View.GONE);
}
if(account.getSocial().toUpperCase().equals("MASTODON")){
custom_fields_container.setVisibility(View.VISIBLE);
}
set_profile_save.setEnabled(false);
set_change_header_picture.setEnabled(false);
set_change_profile_picture.setEnabled(false);

View File

@ -352,6 +352,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
}
retrieveRelationship = new RetrieveRelationshipAsyncTask(getApplicationContext(), accountIdRelation, ShowAccountActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
if (account.getId() != null && account.getId().equals(userId) && (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PIXELFED)) {
account_follow.setVisibility(View.GONE);
header_edit_profile.setVisibility(View.VISIBLE);
header_edit_profile.bringToFront();
}
String urlHeader = account.getHeader();
if (urlHeader != null && urlHeader.startsWith("/")) {
urlHeader = Helper.getLiveInstanceWithProtocol(ShowAccountActivity.this) + account.getHeader();
@ -1018,11 +1024,7 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
account_follow.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(ShowAccountActivity.this, R.color.mastodonC4)));
}
if (account.getId() != null && account.getId().equals(userId) && (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON || MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.PLEROMA)) {
account_follow.setVisibility(View.GONE);
header_edit_profile.setVisibility(View.VISIBLE);
header_edit_profile.bringToFront();
} else if (relationship.isBlocking()) {
if (relationship.isBlocking()) {
account_follow.setImageResource(R.drawable.ic_lock_open);
doAction = action.UNBLOCK;
account_follow.setVisibility(View.VISIBLE);

View File

@ -128,6 +128,8 @@
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/custom_fields_container"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">