Idk what to call this commit, so Note Improver it is

This commit is contained in:
LucasGGamerM
2022-12-27 21:42:21 -03:00
parent 094cd67728
commit 48664bb580
2 changed files with 22 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ import android.view.WindowInsets;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
@@ -116,8 +117,9 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
private SwipeRefreshLayout refreshLayout;
private CoverOverlayGradientDrawable coverGradient=new CoverOverlayGradientDrawable();
private float titleTransY;
private View postsBtn, followersBtn, followingBtn, noteEditConfirm, noteEditWrapper;
private View postsBtn, followersBtn, followingBtn, noteEditWrapper;
private EditText nameEdit, bioEdit, noteEdit;
private ImageButton noteEditConfirm;
private ProgressBar actionProgress, notifyProgress;
private FrameLayout[] tabViews;
private TabLayoutMediator tabLayoutMediator;
@@ -182,6 +184,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
bio=content.findViewById(R.id.bio);
noteEdit=content.findViewById(R.id.note_edit);
noteEditConfirm=content.findViewById(R.id.note_edit_confirm);
noteEditConfirm.setOnClickListener(v->onClickNoteSave());
noteEditWrapper=content.findViewById(R.id.note_edit_wrapper);
followersCount=content.findViewById(R.id.followers_count);
followersLabel=content.findViewById(R.id.followers_label);
@@ -302,6 +305,10 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
return sizeWrapper;
}
private void onClickNoteSave() {
noteEdit.getText().toString();
}
@Override
protected void doLoadData(){
currentRequest=new GetAccountByID(profileAccountID)
@@ -478,6 +485,16 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
noteEditWrapper.setVisibility(View.GONE);
}
if(noteEdit.getText().toString() == null){
noteEditConfirm.setImageResource(R.drawable.ic_fluent_checkmark_24_regular);
noteEditConfirm.setClickable(false);
noteEditConfirm.setAlpha(.50f);
}else{
noteEditConfirm.setImageResource(R.drawable.ic_fluent_checkmark_24_filled);
noteEditConfirm.setClickable(true);
noteEditConfirm.setAlpha(1.0f);
}
followersCount.setText(UiUtils.abbreviateNumber(account.followersCount));
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
postsCount.setText(UiUtils.abbreviateNumber(account.statusesCount));

View File

@@ -280,13 +280,14 @@
android:hint="@string/sk_personal_note"
android:textColorHint="?android:textColorSecondaryInverseNoDisable" />
<Button
<ImageButton
android:id="@+id/note_edit_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_fluent_checkmark_24_regular"
android:src="@drawable/ic_fluent_checkmark_24_regular"
android:backgroundTint="#00000000"
android:layout_marginTop="2dp"
android:layout_marginEnd="20dp"
android:layout_marginEnd="10dp"
android:layout_gravity="right|center_vertical" />
</FrameLayout>