mirror of https://github.com/M66B/FairEmail.git
Link pro
This commit is contained in:
parent
1af694cd86
commit
1a55487a00
|
@ -99,11 +99,13 @@ public class FragmentAccount extends FragmentBase {
|
|||
private Button btnColor;
|
||||
private View vwColor;
|
||||
private ImageButton ibColorDefault;
|
||||
private TextView tvColorPro;
|
||||
|
||||
private Button btnAdvanced;
|
||||
private CheckBox cbSynchronize;
|
||||
private CheckBox cbPrimary;
|
||||
private CheckBox cbNotify;
|
||||
private TextView tvNotifyPro;
|
||||
private CheckBox cbBrowse;
|
||||
private EditText etInterval;
|
||||
private CheckBox cbPartialFetch;
|
||||
|
@ -176,11 +178,13 @@ public class FragmentAccount extends FragmentBase {
|
|||
btnColor = view.findViewById(R.id.btnColor);
|
||||
vwColor = view.findViewById(R.id.vwColor);
|
||||
ibColorDefault = view.findViewById(R.id.ibColorDefault);
|
||||
tvColorPro = view.findViewById(R.id.tvColorPro);
|
||||
|
||||
btnAdvanced = view.findViewById(R.id.btnAdvanced);
|
||||
cbSynchronize = view.findViewById(R.id.cbSynchronize);
|
||||
cbPrimary = view.findViewById(R.id.cbPrimary);
|
||||
cbNotify = view.findViewById(R.id.cbNotify);
|
||||
tvNotifyPro = view.findViewById(R.id.tvNotifyPro);
|
||||
cbBrowse = view.findViewById(R.id.cbBrowse);
|
||||
etInterval = view.findViewById(R.id.etInterval);
|
||||
cbPartialFetch = view.findViewById(R.id.cbPartialFetch);
|
||||
|
@ -312,6 +316,8 @@ public class FragmentAccount extends FragmentBase {
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvColorPro);
|
||||
|
||||
btnAdvanced.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -339,6 +345,8 @@ public class FragmentAccount extends FragmentBase {
|
|||
Helper.hide(view.findViewById(R.id.tvNotifyPro));
|
||||
}
|
||||
|
||||
Helper.linkPro(tvNotifyPro);
|
||||
|
||||
btnCheck.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -89,6 +89,7 @@ public class FragmentIdentity extends FragmentBase {
|
|||
private Button btnColor;
|
||||
private View vwColor;
|
||||
private ImageButton ibColorDefault;
|
||||
private TextView tvColorPro;
|
||||
private EditText etSignature;
|
||||
private Button btnHtml;
|
||||
|
||||
|
@ -157,6 +158,7 @@ public class FragmentIdentity extends FragmentBase {
|
|||
btnColor = view.findViewById(R.id.btnColor);
|
||||
vwColor = view.findViewById(R.id.vwColor);
|
||||
ibColorDefault = view.findViewById(R.id.ibColorDefault);
|
||||
tvColorPro = view.findViewById(R.id.tvColorPro);
|
||||
etSignature = view.findViewById(R.id.etSignature);
|
||||
btnHtml = view.findViewById(R.id.btnHtml);
|
||||
|
||||
|
@ -285,6 +287,8 @@ public class FragmentIdentity extends FragmentBase {
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvColorPro);
|
||||
|
||||
etSignature.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
|
|
@ -48,6 +48,7 @@ import java.text.SimpleDateFormat;
|
|||
public class FragmentOptionsMisc extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private SwitchCompat swBadge;
|
||||
private SwitchCompat swSubscriptions;
|
||||
private TextView tvSubscriptionPro;
|
||||
private SwitchCompat swSubscribedOnly;
|
||||
private SwitchCompat swEnglish;
|
||||
private SwitchCompat swAuthentication;
|
||||
|
@ -85,6 +86,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
|
||||
swBadge = view.findViewById(R.id.swBadge);
|
||||
swSubscriptions = view.findViewById(R.id.swSubscriptions);
|
||||
tvSubscriptionPro = view.findViewById(R.id.tvSubscriptionPro);
|
||||
swSubscribedOnly = view.findViewById(R.id.swSubscribedOnly);
|
||||
swEnglish = view.findViewById(R.id.swEnglish);
|
||||
swAuthentication = view.findViewById(R.id.swAuthentication);
|
||||
|
@ -123,6 +125,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvSubscriptionPro);
|
||||
|
||||
swSubscribedOnly.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
|
|
@ -38,6 +38,7 @@ import android.widget.Button;
|
|||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
@ -54,6 +55,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
|||
private CheckBox cbNotifyActionReply;
|
||||
private CheckBox cbNotifyActionFlag;
|
||||
private CheckBox cbNotifyActionSeen;
|
||||
private TextView tvNotifyActionsPro;
|
||||
private Button btnManage;
|
||||
private ImageButton ibManage;
|
||||
private SwitchCompat swLight;
|
||||
|
@ -81,6 +83,7 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
|||
cbNotifyActionReply = view.findViewById(R.id.cbNotifyActionReply);
|
||||
cbNotifyActionFlag = view.findViewById(R.id.cbNotifyActionFlag);
|
||||
cbNotifyActionSeen = view.findViewById(R.id.cbNotifyActionSeen);
|
||||
tvNotifyActionsPro = view.findViewById(R.id.tvNotifyActionsPro);
|
||||
btnManage = view.findViewById(R.id.btnManage);
|
||||
ibManage = view.findViewById(R.id.ibManage);
|
||||
swLight = view.findViewById(R.id.swLight);
|
||||
|
@ -137,6 +140,8 @@ public class FragmentOptionsNotifications extends FragmentBase implements Shared
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvNotifyActionsPro);
|
||||
|
||||
final Intent manage = getIntentNotifications(getContext());
|
||||
btnManage.setVisibility(manage.resolveActivity(pm) == null ? View.GONE : View.VISIBLE);
|
||||
btnManage.setOnClickListener(new View.OnClickListener() {
|
||||
|
|
|
@ -52,6 +52,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
|||
private SwitchCompat swSchedule;
|
||||
private TextView tvScheduleStart;
|
||||
private TextView tvScheduleEnd;
|
||||
private TextView tvSchedulePro;
|
||||
private SwitchCompat swUnseen;
|
||||
private SwitchCompat swFlagged;
|
||||
private SwitchCompat swSyncKept;
|
||||
|
@ -76,6 +77,7 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
|||
swSchedule = view.findViewById(R.id.swSchedule);
|
||||
tvScheduleStart = view.findViewById(R.id.tvScheduleStart);
|
||||
tvScheduleEnd = view.findViewById(R.id.tvScheduleEnd);
|
||||
tvSchedulePro = view.findViewById(R.id.tvSchedulePro);
|
||||
swUnseen = view.findViewById(R.id.swUnseen);
|
||||
swFlagged = view.findViewById(R.id.swFlagged);
|
||||
swSyncKept = view.findViewById(R.id.swSyncKept);
|
||||
|
@ -148,6 +150,8 @@ public class FragmentOptionsSynchronize extends FragmentBase implements SharedPr
|
|||
}
|
||||
});
|
||||
|
||||
Helper.linkPro(tvSchedulePro);
|
||||
|
||||
swUnseen.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
|
|
@ -47,6 +47,7 @@ import android.widget.CheckBox;
|
|||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -56,6 +57,7 @@ import androidx.core.content.ContextCompat;
|
|||
import androidx.exifinterface.media.ExifInterface;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
@ -661,6 +663,17 @@ public class Helper {
|
|||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean("pro", false);
|
||||
}
|
||||
|
||||
static void linkPro(TextView tv) {
|
||||
tv.getPaint().setUnderlineText(true);
|
||||
tv.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(view.getContext());
|
||||
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_SHOW_PRO));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static <T> List<List<T>> chunkList(List<T> list, int size) {
|
||||
List<List<T>> result = new ArrayList<>(list.size() / size);
|
||||
for (int i = 0; i < list.size(); i += size)
|
||||
|
|
|
@ -327,9 +327,10 @@
|
|||
android:id="@+id/tvColorPro"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnColor" />
|
||||
|
||||
|
@ -376,9 +377,10 @@
|
|||
android:id="@+id/tvNotifyPro"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbNotify" />
|
||||
|
||||
|
|
|
@ -145,9 +145,10 @@
|
|||
android:id="@+id/tvColorPro"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/btnColor" />
|
||||
|
||||
|
|
|
@ -53,10 +53,11 @@
|
|||
android:id="@+id/tvSubscriptionPro"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swSubscriptions" />
|
||||
|
@ -129,6 +130,7 @@
|
|||
android:id="@+id/tvParanoidHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_paranoid_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvNotifyActionsHint" />
|
||||
|
|
|
@ -149,7 +149,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_pro_feature"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
android:textColor="@color/colorAccent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvScheduleHint" />
|
||||
|
||||
|
|
Loading…
Reference in New Issue