mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-01-31 20:51:47 +01:00
Sidebar: Add donation link to app drawer
This creates a donation link that leads to our donation page on the NewPipe website.
This commit is contained in:
parent
3fc0147f47
commit
33ecfb757e
@ -92,6 +92,7 @@ import org.schabi.newpipe.util.SerializedCache;
|
|||||||
import org.schabi.newpipe.util.ServiceHelper;
|
import org.schabi.newpipe.util.ServiceHelper;
|
||||||
import org.schabi.newpipe.util.StateSaver;
|
import org.schabi.newpipe.util.StateSaver;
|
||||||
import org.schabi.newpipe.util.ThemeHelper;
|
import org.schabi.newpipe.util.ThemeHelper;
|
||||||
|
import org.schabi.newpipe.util.external_communication.ShareUtils;
|
||||||
import org.schabi.newpipe.views.FocusOverlayView;
|
import org.schabi.newpipe.views.FocusOverlayView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -120,7 +121,8 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
private static final int ITEM_ID_DOWNLOADS = -4;
|
private static final int ITEM_ID_DOWNLOADS = -4;
|
||||||
private static final int ITEM_ID_HISTORY = -5;
|
private static final int ITEM_ID_HISTORY = -5;
|
||||||
private static final int ITEM_ID_SETTINGS = 0;
|
private static final int ITEM_ID_SETTINGS = 0;
|
||||||
private static final int ITEM_ID_ABOUT = 1;
|
private static final int ITEM_ID_DONATION = 1;
|
||||||
|
private static final int ITEM_ID_ABOUT = 2;
|
||||||
|
|
||||||
private static final int ORDER = 0;
|
private static final int ORDER = 0;
|
||||||
|
|
||||||
@ -262,6 +264,10 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
drawerLayoutBinding.navigation.getMenu()
|
drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
|
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
|
||||||
.setIcon(R.drawable.ic_settings);
|
.setIcon(R.drawable.ic_settings);
|
||||||
|
drawerLayoutBinding.navigation.getMenu()
|
||||||
|
.add(R.id.menu_options_about_group, ITEM_ID_DONATION, ORDER,
|
||||||
|
R.string.donation_title)
|
||||||
|
.setIcon(R.drawable.volunteer_activism_ic);
|
||||||
drawerLayoutBinding.navigation.getMenu()
|
drawerLayoutBinding.navigation.getMenu()
|
||||||
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
|
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
|
||||||
.setIcon(R.drawable.ic_info_outline);
|
.setIcon(R.drawable.ic_info_outline);
|
||||||
@ -337,6 +343,9 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
case ITEM_ID_SETTINGS:
|
case ITEM_ID_SETTINGS:
|
||||||
NavigationHelper.openSettings(this);
|
NavigationHelper.openSettings(this);
|
||||||
break;
|
break;
|
||||||
|
case ITEM_ID_DONATION:
|
||||||
|
ShareUtils.openUrlInBrowser(this, getString(R.string.donation_url));
|
||||||
|
break;
|
||||||
case ITEM_ID_ABOUT:
|
case ITEM_ID_ABOUT:
|
||||||
NavigationHelper.openAbout(this);
|
NavigationHelper.openAbout(this);
|
||||||
break;
|
break;
|
||||||
@ -924,4 +933,5 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return sheetState == BottomSheetBehavior.STATE_HIDDEN
|
return sheetState == BottomSheetBehavior.STATE_HIDDEN
|
||||||
|| sheetState == BottomSheetBehavior.STATE_COLLAPSED;
|
|| sheetState == BottomSheetBehavior.STATE_COLLAPSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
9
app/src/main/res/drawable-mdpi/volunteer_activism_ic.xml
Normal file
9
app/src/main/res/drawable-mdpi/volunteer_activism_ic.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="960"
|
||||||
|
android:viewportHeight="960">
|
||||||
|
<path
|
||||||
|
android:pathData="M640,520 L474,358q-31,-30 -52.5,-66.5T400,212q0,-55 38.5,-93.5T532,80q32,0 60,13.5t48,36.5q20,-23 48,-36.5t60,-13.5q55,0 93.5,38.5T880,212q0,43 -21,79.5T807,358L640,520ZM640,408 L749,301q19,-19 35,-40.5t16,-48.5q0,-22 -15,-37t-37,-15q-14,0 -26.5,5.5T700,182l-60,72 -60,-72q-9,-11 -21.5,-16.5T532,160q-22,0 -37,15t-15,37q0,27 16,48.5t35,40.5l109,107ZM280,740l278,76 238,-74q-5,-9 -14.5,-15.5T760,720L558,720q-27,0 -43,-2t-33,-8l-93,-31 22,-78 81,27q17,5 40,8t68,4q0,-11 -6.5,-21T578,606l-234,-86h-64v220ZM40,880v-440h304q7,0 14,1.5t13,3.5l235,87q33,12 53.5,42t20.5,66h80q50,0 85,33t35,87v40L560,900l-280,-78v58L40,880ZM120,800h80v-280h-80v280ZM640,254Z"
|
||||||
|
android:fillColor="#FF000000"/>
|
||||||
|
</vector>
|
Loading…
x
Reference in New Issue
Block a user