Revert "Inline hide pro banner"

This reverts commit 8d4f396757.
pull/213/head
M66B 1 year ago
parent 2fb2e054db
commit 554a382184

@ -251,8 +251,7 @@ public class FragmentMessages extends FragmentBase
private TextView tvAirplane;
private TextView tvNotifications;
private TextView tvBatteryOptimizations;
private TextView tvHintPro;
private ImageButton ibHintPro;
private TextView tvSupport;
private ImageButton ibHintSupport;
private ImageButton ibHintSwipe;
private ImageButton ibHintSelect;
@ -276,7 +275,7 @@ public class FragmentMessages extends FragmentBase
private Group grpAirplane;
private Group grpNotifications;
private Group grpBatteryOptimizations;
private Group grpPro;
private Group grpSupport;
private Group grpHintSupport;
private Group grpHintSwipe;
private Group grpHintSelect;
@ -558,8 +557,7 @@ public class FragmentMessages extends FragmentBase
tvAirplane = view.findViewById(R.id.tvAirplane);
tvNotifications = view.findViewById(R.id.tvNotifications);
tvBatteryOptimizations = view.findViewById(R.id.tvBatteryOptimizations);
tvHintPro = view.findViewById(R.id.tvHintPro);
ibHintPro = view.findViewById(R.id.ibHintPro);
tvSupport = view.findViewById(R.id.tvSupport);
ibHintSupport = view.findViewById(R.id.ibHintSupport);
ibHintSwipe = view.findViewById(R.id.ibHintSwipe);
ibHintSelect = view.findViewById(R.id.ibHintSelect);
@ -584,7 +582,7 @@ public class FragmentMessages extends FragmentBase
grpAirplane = view.findViewById(R.id.grpAirplane);
grpNotifications = view.findViewById(R.id.grpNotifications);
grpBatteryOptimizations = view.findViewById(R.id.grpBatteryOptimizations);
grpPro = view.findViewById(R.id.grpPro);
grpSupport = view.findViewById(R.id.grpSupport);
grpHintSupport = view.findViewById(R.id.grpHintSupport);
grpHintSwipe = view.findViewById(R.id.grpHintSwipe);
grpHintSelect = view.findViewById(R.id.grpHintSelect);
@ -659,20 +657,11 @@ public class FragmentMessages extends FragmentBase
}
});
grpPro.setVisibility(View.GONE);
tvHintPro.setOnClickListener(new View.OnClickListener() {
grpSupport.setVisibility(View.GONE);
tvSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(v.getContext(), ActivityBilling.class));
}
});
ibHintPro.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
long banner_hidden = new Date().getTime() + FragmentPro.HIDE_BANNER * 7 * 24 * 3600 * 1000L;
prefs.edit().putLong("banner_hidden", banner_hidden).apply();
startActivity(new Intent(v.getContext(), ActivityBilling.class));
startActivity(new Intent(getContext(), ActivityBilling.class));
}
});
@ -5158,11 +5147,11 @@ public class FragmentMessages extends FragmentBase
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (grpPro != null &&
if (grpSupport != null &&
("pro".equals(key) || "banner_hidden".equals(key))) {
boolean pro = ActivityBilling.isPro(getContext());
long banner_hidden = prefs.getLong("banner_hidden", 0);
grpPro.setVisibility(
grpSupport.setVisibility(
!pro && banner_hidden == 0 && viewType == AdapterMessage.ViewType.UNIFIED
? View.VISIBLE : View.GONE);
}

@ -68,7 +68,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
private Button btnConsume;
private ImageView ivConnected;
static final int HIDE_BANNER = 4; // weeks
private static final int HIDE_BANNER = 4; // weeks
@Override
@Nullable

@ -92,37 +92,24 @@
app:layout_constraintTop_toBottomOf="@id/tvBatteryOptimizations" />
<TextView
android:id="@+id/tvHintPro"
android:layout_width="0dp"
android:id="@+id/tvSupport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="36dp"
android:layout_gravity="center_vertical"
android:padding="6dp"
android:text="@string/title_pro_support"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibHintPro"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorBatteryOptimizations" />
<ImageButton
android:id="@+id/ibHintPro"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_legend_close_hint"
android:padding="9dp"
app:layout_constraintBottom_toBottomOf="@id/tvHintPro"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvHintPro"
app:srcCompat="@drawable/twotone_close_24" />
<View
android:id="@+id/vSeparatorSupport"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHintPro" />
app:layout_constraintTop_toBottomOf="@id/tvSupport" />
<TextView
android:id="@+id/tvHintSupport"
@ -510,10 +497,10 @@
app:constraint_referenced_ids="tvBatteryOptimizations,vSeparatorBatteryOptimizations" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpPro"
android:id="@+id/grpSupport"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="tvHintPro,ibHintPro,vSeparatorSupport" />
app:constraint_referenced_ids="tvSupport,vSeparatorSupport" />
<androidx.constraintlayout.widget.Group
android:id="@+id/grpHintSupport"

Loading…
Cancel
Save