Small layout improvement

pull/214/head
M66B 9 months ago
parent 9ff0ce2685
commit f78151e5c8

@ -23,6 +23,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.Paint;
import android.net.Uri;
import android.os.Bundle;
@ -43,6 +44,8 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.core.graphics.ColorUtils;
import androidx.core.widget.TextViewCompat;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager;
@ -280,7 +283,12 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
post(new Runnable() {
@Override
public void run() {
int color = Helper.resolveColor(btnPurchase.getContext(), R.attr.colorInfoForeground);
if (purchased)
color = ColorUtils.setAlphaComponent(color, (int) Math.round(0.6 * 255));
btnPurchase.setEnabled(!purchased);
btnPurchase.setTextColor(color);
TextViewCompat.setCompoundDrawableTintList(btnPurchase, ColorStateList.valueOf(color));
tvPending.setVisibility(View.GONE);
btnConsume.setEnabled(purchased);
}

@ -31,6 +31,7 @@
android:layout_height="wrap_content"
android:text="@string/title_pro_activated"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textColor="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPending" />

Loading…
Cancel
Save