Replacements

This commit is contained in:
Thomas 2022-11-28 15:56:58 +01:00
parent 0ab66d34c1
commit 8a883de5a0
11 changed files with 58 additions and 53 deletions

View File

@ -395,14 +395,14 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
if (holder.getLayoutPosition() == (getItemCount() - 1)) {
if (statusList.size() > statusCount + 1) {
if (canBeRemoved(statusList.get(statusList.size() - 1))) {
holder.binding.addRemoveStatus.setImageResource(R.drawable.ic_compose_thread_remove_status);
holder.binding.addRemoveStatus.setIconResource(R.drawable.ic_compose_thread_remove_status);
holder.binding.addRemoveStatus.setContentDescription(context.getString(R.string.remove_status));
holder.binding.addRemoveStatus.setOnClickListener(v -> {
manageDrafts.onItemDraftDeleted(statusList.get(holder.getLayoutPosition()), holder.getLayoutPosition());
notifyItemChanged((getItemCount() - 1));
});
} else {
holder.binding.addRemoveStatus.setImageResource(R.drawable.ic_compose_thread_add_status);
holder.binding.addRemoveStatus.setIconResource(R.drawable.ic_compose_thread_add_status);
holder.binding.addRemoveStatus.setContentDescription(context.getString(R.string.add_status));
holder.binding.addRemoveStatus.setOnClickListener(v -> {
manageDrafts.onItemDraftAdded(holder.getLayoutPosition());
@ -410,7 +410,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
});
}
} else {
holder.binding.addRemoveStatus.setImageResource(R.drawable.ic_compose_thread_add_status);
holder.binding.addRemoveStatus.setIconResource(R.drawable.ic_compose_thread_add_status);
holder.binding.addRemoveStatus.setContentDescription(context.getString(R.string.add_status));
holder.binding.addRemoveStatus.setOnClickListener(v -> {
manageDrafts.onItemDraftAdded(holder.getLayoutPosition());
@ -1251,19 +1251,19 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
switch (statusDraft.visibility.toLowerCase()) {
case "public":
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_public);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_public);
statusDraft.visibility = MastodonHelper.visibility.PUBLIC.name();
break;
case "unlisted":
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_unlisted);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_unlisted);
statusDraft.visibility = MastodonHelper.visibility.UNLISTED.name();
break;
case "private":
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_private);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_private);
statusDraft.visibility = MastodonHelper.visibility.PRIVATE.name();
break;
case "direct":
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_direct);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_direct);
statusDraft.visibility = MastodonHelper.visibility.DIRECT.name();
break;
}
@ -1273,23 +1273,23 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.buttonCloseVisibilityPanel.setOnClickListener(v -> holder.binding.visibilityPanel.setVisibility(View.GONE));
holder.binding.buttonVisibilityDirect.setOnClickListener(v -> {
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_direct);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_direct);
statusDraft.visibility = MastodonHelper.visibility.DIRECT.name();
});
holder.binding.buttonVisibilityPrivate.setOnClickListener(v -> {
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_private);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_private);
statusDraft.visibility = MastodonHelper.visibility.PRIVATE.name();
});
holder.binding.buttonVisibilityUnlisted.setOnClickListener(v -> {
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_unlisted);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_unlisted);
statusDraft.visibility = MastodonHelper.visibility.UNLISTED.name();
});
holder.binding.buttonVisibilityPublic.setOnClickListener(v -> {
holder.binding.visibilityPanel.setVisibility(View.GONE);
holder.binding.buttonVisibility.setImageResource(R.drawable.ic_compose_visibility_public);
holder.binding.buttonVisibility.setIconResource(R.drawable.ic_compose_visibility_public);
statusDraft.visibility = MastodonHelper.visibility.PUBLIC.name();
unlisted_changed = true;
});

View File

@ -106,7 +106,6 @@
android:layout_margin="10dp"
android:contentDescription="@string/make_an_action"
android:scaleType="fitCenter"
android:tint="@color/white"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/avatar_container"
app:layout_constraintTop_toBottomOf="@id/banner_container"

View File

@ -246,7 +246,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:backgroundTint="?colorPrimaryDark"
app:layout_collapseMode="pin">
<androidx.appcompat.widget.AppCompatImageView

View File

@ -31,8 +31,7 @@
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="?colorPrimaryDark">
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -97,7 +97,6 @@
android:layout_margin="10dp"
android:contentDescription="@string/make_an_action"
android:scaleType="fitCenter"
android:tint="@color/white"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/avatar_container"
app:layout_constraintTop_toBottomOf="@id/banner_container"

View File

@ -10,10 +10,12 @@
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:id="@+id/fetch_more_max"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:strokeColor="?colorPrimary"
android:contentDescription="@string/fetch_more_messages"
app:icon="@drawable/ic_baseline_keyboard_double_arrow_down_24" />
@ -24,7 +26,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="?colorAccent"
android:textColor="?colorPrimary"
android:text="@string/fetch_more_messages"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
@ -33,7 +35,9 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/fetch_more_min"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_gravity="center"
app:strokeColor="?colorPrimary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/fetch_more_messages"

View File

@ -108,19 +108,20 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/reject_button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_baseline_close_24" />
android:icon="@drawable/ic_baseline_close_24" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/accept_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:src="@drawable/ic_check_white_24dp" />

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -20,13 +21,14 @@
android:layout_height="48dp"
/>
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/delete_keyword"
style="@style/Widget.AppCompat.Button.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
app:icon="@drawable/ic_baseline_delete_24"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="20dp"
android:contentDescription="@string/delete_keyword"
android:scaleType="fitCenter"
android:src="@drawable/ic_baseline_delete_24" />
app:strokeColor="?colorPrimary" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -549,13 +549,13 @@
android:gravity="end"
android:visibility="gone">
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/action_share"
style="@style/Widget.AppCompat.Button.Borderless"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="28dp"
android:layout_height="28dp"
android:adjustViewBounds="true"
app:srcCompat="@drawable/ic_baseline_share_24" />
app:icon="@drawable/ic_baseline_share_24" />
</androidx.appcompat.widget.LinearLayoutCompat>
<include

View File

@ -34,14 +34,15 @@
android:orientation="vertical"
android:paddingBottom="6dp">
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/add_remove_status"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="@string/add_status"
android:padding="0dp"
android:src="@drawable/ic_compose_thread_add_status"
app:icon="@drawable/ic_compose_thread_add_status"
app:strokeColor="?colorPrimary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@ -78,23 +79,23 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/content">
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_emoji"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:contentDescription="@string/emoji_picker"
android:src="@drawable/ic_compose_emoji" />
app:icon="@drawable/ic_compose_emoji" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_emoji_one"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:contentDescription="@string/emoji_picker"
android:src="@drawable/ic_baseline_insert_emoticon_24"
app:icon="@drawable/ic_baseline_insert_emoticon_24"
android:visibility="gone"
tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
@ -138,34 +139,34 @@
android:layout_marginHorizontal="6dp"
app:layout_constraintTop_toBottomOf="@id/attachments_list_container" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_attach"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:src="@drawable/ic_compose_attach"
app:icon="@drawable/ic_compose_attach"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_area_divider" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_sensitive"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:src="@drawable/ic_compose_sensitive"
app:icon="@drawable/ic_compose_sensitive"
app:layout_constraintStart_toEndOf="@id/button_attach"
app:layout_constraintTop_toBottomOf="@id/text_area_divider" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_visibility"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:src="@drawable/ic_compose_visibility_public"
app:icon="@drawable/ic_compose_visibility_public"
app:layout_constraintStart_toEndOf="@id/button_sensitive"
app:layout_constraintTop_toBottomOf="@id/text_area_divider" />
@ -174,6 +175,7 @@
style="@style/Widget.Material3.Button.OutlinedButton"
android:layout_marginTop="6dp"
android:layout_width="wrap_content"
android:textColor="?colorPrimary"
android:layout_height="wrap_content"
android:gravity="center"
android:textAlignment="center"
@ -208,14 +210,15 @@
app:layout_constraintStart_toEndOf="@id/button_language"
app:layout_constraintTop_toBottomOf="@id/character_count" />
<androidx.appcompat.widget.AppCompatImageButton
<com.google.android.material.button.MaterialButton
android:id="@+id/button_post"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
style="@style/Widget.Material3.Button.Icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="6dp"
android:src="@drawable/ic_compose_post"
app:icon="@drawable/ic_compose_post"
app:iconTint="?colorControlNormal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/text_area_divider" />

View File

@ -80,7 +80,6 @@
android:layout_margin="10dp"
android:contentDescription="@string/make_an_action"
android:scaleType="fitCenter"
android:tint="@color/white"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@id/avatar_container"
app:layout_constraintTop_toBottomOf="@id/banner_container"