mirror of https://codeberg.org/gitnex/GitNex.git
Add a badge to dashboard nav item
This commit is contained in:
parent
51b90310d7
commit
b7b47aa661
|
@ -710,13 +710,13 @@ public class IssueDetailActivity extends BaseActivity
|
|||
ctx.getResources().getColor(R.color.colorWhite, null)));
|
||||
viewBinding.issuePrState.setBackgroundResource(R.drawable.shape_draft_release);
|
||||
viewBinding.issuePrState.setPadding(
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen8dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen4dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen2dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen8dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen4dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen2dp));
|
||||
|
||||
viewBinding.toolbarTitle.setPadding(
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen16dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen12dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen0dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen0dp),
|
||||
(int) ctx.getResources().getDimension(R.dimen.dimen0dp));
|
||||
|
|
|
@ -164,6 +164,11 @@ public class MainActivity extends BaseActivity
|
|||
|
||||
Menu menu = navigationView.getMenu();
|
||||
navNotifications = menu.findItem(R.id.nav_notifications);
|
||||
MenuItem navDashboard = menu.findItem(R.id.nav_dashboard);
|
||||
|
||||
navDashboard.getActionView().findViewById(R.id.betaBadge).setVisibility(View.VISIBLE);
|
||||
TextView dashboardBetaView = navDashboard.getActionView().findViewById(R.id.betaBadge);
|
||||
dashboardBetaView.setText(R.string.beta);
|
||||
|
||||
navigationView
|
||||
.getViewTreeObserver()
|
||||
|
|
|
@ -303,7 +303,7 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
(int) context.getResources().getDimension(R.dimen.dimen4dp),
|
||||
(int) context.getResources().getDimension(R.dimen.dimen0dp));
|
||||
this.prTitle.setPadding(
|
||||
(int) context.getResources().getDimension(R.dimen.dimen16dp),
|
||||
(int) context.getResources().getDimension(R.dimen.dimen12dp),
|
||||
(int) context.getResources().getDimension(R.dimen.dimen0dp),
|
||||
(int) context.getResources().getDimension(R.dimen.dimen0dp),
|
||||
(int) context.getResources().getDimension(R.dimen.dimen0dp));
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/dimen4dp"/>
|
||||
<solid
|
||||
android:color="?attr/primaryTextColor"/>
|
||||
<padding
|
||||
android:bottom="@dimen/dimen2dp"
|
||||
android:left="@dimen/dimen4dp"
|
||||
android:right="@dimen/dimen4dp"
|
||||
android:top="@dimen/dimen2dp"/>
|
||||
|
||||
</shape>
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/betaBadge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_beta_badge"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="@dimen/dimen4dp"
|
||||
android:paddingEnd="@dimen/dimen4dp"
|
||||
android:singleLine="true"
|
||||
android:layout_marginEnd="@dimen/dimen140dp"
|
||||
android:textColor="?attr/primaryBackgroundColor"
|
||||
android:textSize="@dimen/dimen12sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
|
@ -10,6 +10,7 @@
|
|||
<item android:id="@+id/nav_dashboard"
|
||||
android:icon="@drawable/ic_dashboard"
|
||||
android:title="@string/dashboard"
|
||||
app:actionLayout="@layout/badge_beta"
|
||||
android:visible="false"/>
|
||||
|
||||
<item android:id="@+id/nav_home"
|
||||
|
|
|
@ -515,6 +515,7 @@
|
|||
<string name="openInBrowser">Open in Browser</string>
|
||||
<string name="deleteGenericTitle">Delete %s</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="beta">beta</string>
|
||||
<!-- generic copy -->
|
||||
|
||||
<string name="exploreUsers">Explore users</string>
|
||||
|
|
Loading…
Reference in New Issue