forked from mirrors/Fedilab
Some cosmetic
This commit is contained in:
parent
1fbce05dbd
commit
542477f37f
13 changed files with 34 additions and 71 deletions
|
@ -37,7 +37,6 @@ import app.fedilab.android.databinding.ActivityPartnershipBinding;
|
|||
import app.fedilab.android.helper.CrossActionHelper;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.helper.MastodonHelper;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
import app.fedilab.android.viewmodel.mastodon.AccountsVM;
|
||||
|
||||
|
||||
|
@ -62,7 +61,6 @@ public class PartnerShipActivity extends BaseActivity {
|
|||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://masto.host"));
|
||||
startActivity(browserIntent);
|
||||
});
|
||||
binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(PartnerShipActivity.this));
|
||||
setTitle(R.string.action_partnership);
|
||||
binding.accountFollow.setIconResource(R.drawable.ic_baseline_person_add_24);
|
||||
CrossActionHelper.fetchRemoteAccount(PartnerShipActivity.this, "@mastohost@mastodon.social", new CrossActionHelper.Callback() {
|
||||
|
|
|
@ -341,7 +341,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
else
|
||||
binding.warningContainer.setVisibility(View.GONE);
|
||||
|
||||
binding.openRemoteProfile.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(ProfileActivity.this));
|
||||
if (checkRemotely) {
|
||||
binding.openRemoteProfile.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -521,7 +520,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
});
|
||||
}
|
||||
}
|
||||
binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(ProfileActivity.this));
|
||||
|
||||
binding.accountFollow.setEnabled(true);
|
||||
//Visibility depending of the relationship
|
||||
|
@ -570,7 +568,6 @@ public class ProfileActivity extends BaseActivity {
|
|||
binding.headerEditProfile.setVisibility(View.VISIBLE);
|
||||
binding.headerEditProfile.bringToFront();
|
||||
}
|
||||
binding.headerEditProfile.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(ProfileActivity.this));
|
||||
if (!relationship.following) {
|
||||
binding.accountNotification.setVisibility(View.GONE);
|
||||
} else {
|
||||
|
|
|
@ -1844,7 +1844,6 @@ public class Helper {
|
|||
binding.aboutSupport.setVisibility(View.GONE);
|
||||
binding.aboutSupportPaypal.setVisibility(View.GONE);
|
||||
}
|
||||
binding.accountFollow.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(activity));
|
||||
binding.accountFollow.setImageResource(R.drawable.ic_baseline_person_add_24);
|
||||
binding.aboutSupport.setOnClickListener(v -> {
|
||||
Intent intentLiberapay = new Intent(Intent.ACTION_VIEW);
|
||||
|
|
|
@ -362,9 +362,6 @@ public class MastodonHelper {
|
|||
dialogBuilder.setView(binding.getRoot());
|
||||
final AlertDialog alertDialogBoost = dialogBuilder.create();
|
||||
binding.timePicker.setIs24HourView(true);
|
||||
binding.dateTimeNext.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context));
|
||||
binding.dateTimePrevious.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context));
|
||||
binding.dateTimeSet.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context));
|
||||
//Buttons management
|
||||
binding.dateTimeCancel.setOnClickListener(v -> alertDialogBoost.dismiss());
|
||||
binding.dateTimeNext.setOnClickListener(v -> {
|
||||
|
|
|
@ -33,7 +33,6 @@ import android.view.animation.TranslateAnimation;
|
|||
import androidx.annotation.AttrRes;
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.ColorUtils;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
@ -69,25 +68,6 @@ public class ThemeHelper {
|
|||
}
|
||||
|
||||
|
||||
public static ColorStateList getButtonActionColorStateList(Context context) {
|
||||
int[][] states = new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled}, // disabled
|
||||
new int[]{-android.R.attr.state_checked}, // unchecked
|
||||
new int[]{android.R.attr.state_pressed} // pressed
|
||||
};
|
||||
int alphaColor = ColorUtils.setAlphaComponent(ContextCompat.getColor(context, R.color.colorAccent), 0x33);
|
||||
int color = ContextCompat.getColor(context, R.color.colorAccent);
|
||||
int[] colors = new int[]{
|
||||
color,
|
||||
alphaColor,
|
||||
color,
|
||||
color
|
||||
};
|
||||
return new ColorStateList(states, colors);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Animate two views, the current view will be hidden to left
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.util.List;
|
|||
import app.fedilab.android.R;
|
||||
import app.fedilab.android.client.entities.api.Filter;
|
||||
import app.fedilab.android.databinding.DrawerKeywordBinding;
|
||||
import app.fedilab.android.helper.ThemeHelper;
|
||||
|
||||
public class KeywordAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
||||
private final List<Filter.KeywordsParams> keywordsParamsList;
|
||||
|
@ -87,7 +86,6 @@ public class KeywordAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
|
|||
} else {
|
||||
holder.binding.mainContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
holder.binding.deleteKeyword.setBackgroundTintList(ThemeHelper.getButtonActionColorStateList(context));
|
||||
holder.binding.wholeWord.setOnCheckedChangeListener((compoundButton, checked) -> keywordsParams.whole_word = checked);
|
||||
holder.binding.wholeWord.setChecked(keywordsParams.whole_word != null && keywordsParams.whole_word);
|
||||
holder.binding.deleteKeyword.setOnClickListener(v -> {
|
||||
|
|
|
@ -248,7 +248,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
} else if (getItemViewType(position) == TYPE_POLL) {
|
||||
holderStatus.bindingNotification.status.typeOfNotification.setImageResource(R.drawable.ic_baseline_poll_24);
|
||||
}
|
||||
|
||||
holderStatus.bindingNotification.status.mainContainer.setAlpha(1.0f);
|
||||
StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class);
|
||||
SearchVM searchVM = new ViewModelProvider((ViewModelStoreOwner) context).get(SearchVM.class);
|
||||
if (notification.status != null) {
|
||||
|
@ -256,7 +256,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
}
|
||||
statusManagement(context, statusesVM, searchVM, holderStatus, this, null, notification.status, Timeline.TimeLineEnum.NOTIFICATION, false, true, false, null);
|
||||
holderStatus.bindingNotification.status.dateShort.setText(Helper.dateDiff(context, notification.created_at));
|
||||
holderStatus.bindingNotification.containerTransparent.setAlpha(.3f);
|
||||
|
||||
if (getItemViewType(position) == TYPE_MENTION || getItemViewType(position) == TYPE_STATUS || getItemViewType(position) == TYPE_REACTION) {
|
||||
holderStatus.bindingNotification.status.actionButtons.setVisibility(View.VISIBLE);
|
||||
String title = "";
|
||||
|
@ -280,21 +280,17 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
// start the new activity
|
||||
context.startActivity(intent, options.toBundle());
|
||||
});
|
||||
holderStatus.bindingNotification.status.mainContainer.setAlpha(.8f);
|
||||
}
|
||||
holderStatus.bindingNotification.status.displayName.setText(
|
||||
notification.account.getSpanDisplayNameTitle(context,
|
||||
new WeakReference<>(holderStatus.bindingNotification.status.displayName), title),
|
||||
TextView.BufferType.SPANNABLE);
|
||||
holderStatus.bindingNotification.status.username.setText(String.format("@%s", notification.account.acct));
|
||||
holderStatus.bindingNotification.containerTransparent.setAlpha(.1f);
|
||||
if (notification.status != null && notification.status.visibility.equalsIgnoreCase("direct")) {
|
||||
holderStatus.bindingNotification.containerTransparent.setVisibility(View.GONE);
|
||||
} else {
|
||||
holderStatus.bindingNotification.containerTransparent.setVisibility(View.VISIBLE);
|
||||
holderStatus.bindingNotification.containerTransparent.setAlpha(.1f);
|
||||
}
|
||||
|
||||
} else {
|
||||
holderStatus.bindingNotification.containerTransparent.setVisibility(View.VISIBLE);
|
||||
holderStatus.bindingNotification.status.mainContainer.setAlpha(.7f);
|
||||
holderStatus.bindingNotification.status.mainContainer.setVisibility(View.VISIBLE);
|
||||
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean displayMedia = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_MEDIA_NOTIFICATION), true);
|
||||
if (displayMedia && notification.status != null && notification.status.media_attachments != null && notification.status.media_attachments.size() > 0) {
|
||||
|
|
|
@ -1500,17 +1500,19 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
|
|||
Status fetchedStatus = results.statuses.get(0);
|
||||
statusesVM.votePoll(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, fetchedStatus.poll.id, choice)
|
||||
.observe((LifecycleOwner) context, poll -> {
|
||||
int i = 0;
|
||||
for (Poll.PollItem item : statusToDeal.poll.options) {
|
||||
if (item.span_title != null) {
|
||||
poll.options.get(i).span_title = item.span_title;
|
||||
} else {
|
||||
poll.options.get(i).span_title = new SpannableString(item.title);
|
||||
if (poll != null) {
|
||||
int i = 0;
|
||||
for (Poll.PollItem item : statusToDeal.poll.options) {
|
||||
if (item.span_title != null) {
|
||||
poll.options.get(i).span_title = item.span_title;
|
||||
} else {
|
||||
poll.options.get(i).span_title = new SpannableString(item.title);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
i++;
|
||||
statusToDeal.poll = poll;
|
||||
adapter.notifyItemChanged(holder.getBindingAdapterPosition());
|
||||
}
|
||||
statusToDeal.poll = poll;
|
||||
adapter.notifyItemChanged(holder.getBindingAdapterPosition());
|
||||
});
|
||||
} else {
|
||||
Toasty.info(context, context.getString(R.string.toast_error_search), Toasty.LENGTH_SHORT).show();
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
android:id="@+id/fetch_more_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="0dp"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
app:strokeColor="?colorPrimary"
|
||||
android:contentDescription="@string/fetch_more_messages"
|
||||
app:icon="@drawable/ic_baseline_keyboard_double_arrow_down_24" />
|
||||
|
@ -25,7 +27,6 @@
|
|||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:textColor="?colorPrimary"
|
||||
android:text="@string/fetch_more_messages"
|
||||
android:textAlignment="center"
|
||||
|
@ -36,8 +37,10 @@
|
|||
<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:padding="0dp"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/fetch_more_messages"
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="5dp"
|
||||
android:tint="?colorPrimary"
|
||||
android:src="@drawable/ic_baseline_supervised_user_circle_24" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
@ -111,20 +112,19 @@
|
|||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/reject_button"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:adjustViewBounds="true"
|
||||
app:icon="@drawable/ic_baseline_close_24" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/accept_button"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton"
|
||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@drawable/ic_check_white_24dp" />
|
||||
app:icon="@drawable/ic_check_white_24dp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
|
|
@ -256,6 +256,7 @@
|
|||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:orientation="vertical"
|
||||
tools:visibility="visible"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
|
@ -276,11 +277,14 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/translation_label"
|
||||
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:paddingStart="2dp"
|
||||
android:background="?colorOnSurfaceInverse"
|
||||
android:paddingEnd="2dp"
|
||||
android:elevation="2dp"
|
||||
android:text="@string/translation"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:clipToPadding="false"
|
||||
app:cardElevation="5dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
@ -226,7 +226,6 @@
|
|||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
app:icon="@drawable/ic_compose_post"
|
||||
app:iconTint="?colorControlNormal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/text_area_divider" />
|
||||
|
||||
|
@ -236,6 +235,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:elevation="2dp"
|
||||
android:background="?colorSurfaceVariant"
|
||||
android:visibility="gone"
|
||||
app:constraint_referenced_ids="button_attach_image,button_attach_audio,button_attach_video,button_close_attachment_panel,button_poll,button_attach_manual"
|
||||
app:flow_maxElementsWrap="3"
|
||||
|
@ -295,6 +295,7 @@
|
|||
android:orientation="vertical"
|
||||
android:padding="6dp"
|
||||
android:visibility="gone"
|
||||
android:background="?colorSurfaceVariant"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1">
|
||||
|
|
|
@ -59,16 +59,4 @@
|
|||
</HorizontalScrollView>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/container_transparent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/black"
|
||||
android:elevation="5dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue