Fix F-Droid support on report fragment (link to google) and fix creator when empty
This commit is contained in:
parent
edbce7aab8
commit
a1e241c294
|
@ -93,7 +93,7 @@ public class ReportViewModel extends BaseObservable {
|
|||
|
||||
@Bindable
|
||||
public boolean getCreatorVisibility() {
|
||||
return reportDisplay.creator != null;
|
||||
return reportDisplay.creator != null && !reportDisplay.creator.isEmpty();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
|
@ -170,6 +170,10 @@ public class ReportViewModel extends BaseObservable {
|
|||
return reportDisplay.source;
|
||||
}
|
||||
|
||||
public String getViewOnStore() {
|
||||
return reportDisplay.viewOnStore;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -130,9 +130,12 @@ public class ReportFragment extends Fragment implements Updatable {
|
|||
reportBinding.permissionExplanation.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
reportBinding.permissionExplanation.setClickable(true);
|
||||
|
||||
reportBinding.viewPlay.setOnClickListener(v -> {
|
||||
reportBinding.viewStore.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
if(reportDisplay.source.contains("google"))
|
||||
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id="+reportDisplay.packageName));
|
||||
else
|
||||
intent.setData(Uri.parse("https://f-droid.org/packages/"+reportDisplay.packageName));
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ public class ReportDisplay {
|
|||
public List<Permission> permissions;
|
||||
public Set<Tracker> trackers;
|
||||
public String source;
|
||||
public String viewOnStore;
|
||||
|
||||
|
||||
private ReportDisplay(){
|
||||
|
@ -43,6 +44,7 @@ public class ReportDisplay {
|
|||
|
||||
reportDisplay.report = model.report;
|
||||
reportDisplay.source = context.getString(R.string.source,model.source);
|
||||
reportDisplay.viewOnStore = context.getString(model.source.equals("google")? R.string.view_on_google_play : R.string.view_on_fdroid);
|
||||
|
||||
reportDisplay.trackers = model.trackers;
|
||||
|
||||
|
|
|
@ -241,11 +241,11 @@
|
|||
android:textColor="@color/colorPurple"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/view_play"
|
||||
android:id="@+id/view_store"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:text="@string/view_on_google_play"
|
||||
android:text="@{reportInfo.viewOnStore}"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/report_url"
|
||||
|
@ -431,7 +431,7 @@
|
|||
android:visibility="@{reportInfo.trackerVisibility ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_play"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_store"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="5dp"
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<string name="and_updated">et mis à jour le</string>
|
||||
<string name="view_on_exodus">Voir sur εxodus ➤</string>
|
||||
<string name="view_on_google_play">Voir sur Google Play ➤</string>
|
||||
<string name="view_on_fdroid">Voir sur F-Droid ➤</string>
|
||||
<string name="downloads">téléchargements</string>
|
||||
<string name="code_signature_found">Nous avons trouvé la signature des pisteurs suivants dans cette application : </string>
|
||||
<string name="code_signature_not_found">Nous n’avons pas trouvé la signature de pisteurs que nous connaissons dans l’application. </string>
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
<string name="and_updated">and updated on</string>
|
||||
<string name="view_on_exodus">See on εxodus ➤</string>
|
||||
<string name="view_on_google_play">See on Google Play ➤</string>
|
||||
<string name="view_on_fdroid">See on F-Droid ➤</string>
|
||||
<string name="downloads">downloads</string>
|
||||
<string name="code_signature_found">We have found code signature of the following trackers in the application:</string>
|
||||
<string name="code_signature_not_found">We have not found code signature of any tracker we know in the application.</string>
|
||||
|
|
Loading…
Reference in New Issue