diff --git a/app/src/main/java/io/lbry/browser/MainActivity.java b/app/src/main/java/io/lbry/browser/MainActivity.java index 854fd6cb..0d4e70ef 100644 --- a/app/src/main/java/io/lbry/browser/MainActivity.java +++ b/app/src/main/java/io/lbry/browser/MainActivity.java @@ -17,6 +17,7 @@ import android.content.res.Configuration; import android.content.res.TypedArray; import android.database.sqlite.SQLiteDatabase; import android.graphics.Color; +import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; @@ -26,7 +27,10 @@ import android.os.Handler; import android.provider.MediaStore; import android.support.v4.media.session.MediaSessionCompat; import android.text.Editable; +import android.text.Spannable; +import android.text.SpannableString; import android.text.TextWatcher; +import android.text.style.TypefaceSpan; import android.util.Base64; import android.util.Log; import android.view.KeyEvent; @@ -63,6 +67,7 @@ import androidx.core.app.NotificationManagerCompat; import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import androidx.core.content.res.ResourcesCompat; +import androidx.core.graphics.TypefaceCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.view.GravityCompat; import androidx.core.view.OnApplyWindowInsetsListener; @@ -542,6 +547,15 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener } } + public void setActionBarTitle(int stringResourceId) { + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + SpannableString spannable = new SpannableString(getString(stringResourceId)); + spannable.setSpan(new TypefaceSpan("inter"), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + actionBar.setTitle(spannable); + } + } + public void addScreenOrientationListener(ScreenOrientationListener listener) { if (!screenOrientationListeners.contains(listener)) { screenOrientationListeners.add(listener); diff --git a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java index 441ba9b1..e8ae6052 100644 --- a/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/channel/ChannelFormFragment.java @@ -503,10 +503,8 @@ public class ChannelFormFragment extends BaseFragment implements activity.addFilePickerListener(this); activity.addWalletBalanceListener(this); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(editMode ? R.string.edit_channel : R.string.create_a_channel); - } + activity.setActionBarTitle(editMode ? R.string.edit_channel : R.string.create_a_channel); + } } @@ -544,10 +542,7 @@ public class ChannelFormFragment extends BaseFragment implements LbryAnalytics.setCurrentScreen(activity, "Channel Form", "ChannelForm"); activity.addStoragePermissionListener(this); if (editMode) { - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(R.string.edit_channel); - } + activity.setActionBarTitle(R.string.edit_channel); } } String filterText = Helper.getValue(inputTagFilter.getText()); diff --git a/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java b/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java index 0923ad1b..8091014f 100644 --- a/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/other/AboutFragment.java @@ -180,10 +180,7 @@ public class AboutFragment extends BaseFragment implements SdkStatusListener { activity.lockDrawer(); activity.hideFloatingWalletBalance(); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(R.string.about_lbry); - } + activity.setActionBarTitle(R.string.about_lbry); } } diff --git a/app/src/main/java/io/lbry/browser/ui/other/SettingsFragment.java b/app/src/main/java/io/lbry/browser/ui/other/SettingsFragment.java index 6cf4deaf..7e93b6ca 100644 --- a/app/src/main/java/io/lbry/browser/ui/other/SettingsFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/other/SettingsFragment.java @@ -35,10 +35,7 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared activity.lockDrawer(); activity.hideFloatingWalletBalance(); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(R.string.settings); - } + activity.setActionBarTitle(R.string.settings); } } diff --git a/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java b/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java index 7e5614ac..368d7481 100644 --- a/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/publish/PublishFormFragment.java @@ -499,10 +499,7 @@ public class PublishFormFragment extends BaseFragment implements activity.addFilePickerListener(this); activity.addWalletBalanceListener(this); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(editMode ? R.string.edit_content : R.string.new_publish); - } + activity.setActionBarTitle(editMode ? R.string.edit_content : R.string.new_publish); } } @@ -889,10 +886,7 @@ public class PublishFormFragment extends BaseFragment implements LbryAnalytics.setCurrentScreen(activity, "Channel Form", "ChannelForm"); activity.addStoragePermissionListener(this); if (editMode) { - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(R.string.edit_content); - } + activity.setActionBarTitle(R.string.edit_content); } } diff --git a/app/src/main/java/io/lbry/browser/ui/wallet/TransactionHistoryFragment.java b/app/src/main/java/io/lbry/browser/ui/wallet/TransactionHistoryFragment.java index d9b70c7c..32df97ca 100644 --- a/app/src/main/java/io/lbry/browser/ui/wallet/TransactionHistoryFragment.java +++ b/app/src/main/java/io/lbry/browser/ui/wallet/TransactionHistoryFragment.java @@ -10,6 +10,7 @@ import android.widget.ProgressBar; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -48,7 +49,9 @@ public class TransactionHistoryFragment extends BaseFragment implements Transact Context context = getContext(); LinearLayoutManager llm = new LinearLayoutManager(context); transactionList.setLayoutManager(llm); - transactionList.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL)); + DividerItemDecoration itemDecoration = new DividerItemDecoration(context, DividerItemDecoration.VERTICAL); + itemDecoration.setDrawable(ContextCompat.getDrawable(context, R.drawable.thin_divider)); + transactionList.addItemDecoration(itemDecoration); transactionList.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override @@ -133,10 +136,7 @@ public class TransactionHistoryFragment extends BaseFragment implements Transact activity.showNavigationBackIcon(); activity.lockDrawer(); - ActionBar actionBar = activity.getSupportActionBar(); - if (actionBar != null) { - actionBar.setTitle(R.string.transaction_history); - } + activity.setActionBarTitle(R.string.transaction_history); } }