mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-21 07:18:05 -04:00
+Icon/menu to GitLab/appName in AppDetailsActivity +LongClick to forum/appName in AppCardController
This commit is contained in:
@@ -257,7 +257,12 @@ public class AppDetailsActivity extends AppCompatActivity
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (item.getItemId() == R.id.action_share) {
|
||||
if (item.getItemId() == R.id.action_forum) {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://gitlab.com/fdroid/fdroiddata/commits/master/metadata?search="
|
||||
+app.name.replaceAll(" ","%20")));
|
||||
startActivity(browserIntent);
|
||||
return true;
|
||||
} else if (item.getItemId() == R.id.action_share) {
|
||||
Intent shareIntent = new Intent(Intent.ACTION_SEND);
|
||||
shareIntent.setType("text/plain");
|
||||
shareIntent.putExtra(Intent.EXTRA_SUBJECT, app.name);
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.fdroid.fdroid.views.categories;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.IdRes;
|
||||
@@ -30,7 +31,7 @@ import java.util.Locale;
|
||||
* + {@link R.id#new_tag} ({@link TextView}, optional)
|
||||
*/
|
||||
public class AppCardController extends RecyclerView.ViewHolder
|
||||
implements View.OnClickListener {
|
||||
implements View.OnClickListener, View.OnLongClickListener {
|
||||
|
||||
/**
|
||||
* After this many days, don't consider showing the "New" tag next to an app.
|
||||
@@ -68,6 +69,7 @@ public class AppCardController extends RecyclerView.ViewHolder
|
||||
newTag = (TextView) itemView.findViewById(R.id.new_tag);
|
||||
|
||||
itemView.setOnClickListener(this);
|
||||
itemView.setOnLongClickListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,4 +142,18 @@ public class AppCardController extends RecyclerView.ViewHolder
|
||||
activity.startActivity(intent);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* When the user clicks/long https://forum.f-droid.org/search?q=
|
||||
*/
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (currentApp == null) {
|
||||
return true;
|
||||
}
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://forum.f-droid.org/search?q="
|
||||
+currentApp.name.replaceAll(" ","%20")));
|
||||
activity.startActivity(browserIntent);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
app/src/main/res/drawable-xxhdpi/gitlabi.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/gitlabi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable/gitlab.png
Normal file
BIN
app/src/main/res/drawable/gitlab.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 KiB |
@@ -2,6 +2,11 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto" >
|
||||
|
||||
<item
|
||||
android:id="@+id/action_forum"
|
||||
android:icon="@drawable/gitlabi"
|
||||
android:title="@string/menu_search"
|
||||
app:showAsAction="ifRoom"/>
|
||||
<item
|
||||
android:id="@+id/action_share"
|
||||
android:icon="@drawable/ic_share_white"
|
||||
|
||||
Reference in New Issue
Block a user