Manrope just literally as default font.
This commit is contained in:
@ -27,51 +27,35 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(getLayoutResourceId());
|
setContentView(getLayoutResourceId());
|
||||||
|
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/roboto.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/roboto.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "SERIF", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "SERIF", "fonts/roboto.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if(tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/manroperegular.ttf");
|
|
||||||
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/manroperegular.ttf");
|
|
||||||
FontsOverride.setDefaultFont(this, "SERIF", "fonts/manroperegular.ttf");
|
|
||||||
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/sourcecodeproregular.ttf");
|
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/sourcecodeproregular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/sourcecodeproregular.ttf");
|
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/sourcecodeproregular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "SERIF", "fonts/sourcecodeproregular.ttf");
|
FontsOverride.setDefaultFont(this, "SERIF", "fonts/sourcecodeproregular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/sourcecodeproregular.ttf");
|
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/manroperegular.ttf");
|
||||||
|
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/manroperegular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "SERIF", "fonts/manroperegular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "MONOSPACE", "fonts/roboto.ttf");
|
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/manroperegular.ttf");
|
||||||
FontsOverride.setDefaultFont(this, "SERIF", "fonts/roboto.ttf");
|
break;
|
||||||
FontsOverride.setDefaultFont(this, "SANS_SERIF", "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// enabling counter badges by default
|
// enabling counter badges by default
|
||||||
if(!tinyDb.getBoolean("enableCounterBadgesInit")) {
|
if(tinyDb.getString("enableCounterBadgesInit").isEmpty()) {
|
||||||
tinyDb.putBoolean("enableCounterBadges", true);
|
tinyDb.putBoolean("enableCounterBadges", true);
|
||||||
tinyDb.putBoolean("enableCounterBadgesInit", true);
|
tinyDb.putString("enableCounterBadgesInit", "yes");
|
||||||
}
|
|
||||||
|
|
||||||
// setting default font
|
|
||||||
if(!tinyDb.getBoolean("customFontStrInit")) {
|
|
||||||
tinyDb.putString("customFontStr", "Manrope");
|
|
||||||
tinyDb.putInt("customFontId", 1);
|
|
||||||
|
|
||||||
tinyDb.putBoolean("customFontStrInit", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -109,24 +109,19 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
|||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
|
toolbarTitle = toolbar.findViewById(R.id.toolbar_title);
|
||||||
|
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/roboto.ttf");
|
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/sourcecodeproregular.ttf");
|
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,24 +58,20 @@ public class OrganizationDetailActivity extends BaseActivity implements BottomSh
|
|||||||
TabLayout tabLayout = findViewById(R.id.tabs);
|
TabLayout tabLayout = findViewById(R.id.tabs);
|
||||||
|
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
}
|
case 0:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/manroperegular.ttf");
|
case 2:
|
||||||
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,24 +92,20 @@ public class RepoDetailActivity extends BaseActivity implements BottomSheetRepoF
|
|||||||
TabLayout tabLayout = findViewById(R.id.tabs);
|
TabLayout tabLayout = findViewById(R.id.tabs);
|
||||||
|
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
}
|
case 0:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/manroperegular.ttf");
|
case 2:
|
||||||
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
myTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getApplicationContext()).getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,24 +84,19 @@ public class RepoStargazersAdapter extends BaseAdapter {
|
|||||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
|
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,24 +84,19 @@ public class RepoWatchersAdapter extends BaseAdapter {
|
|||||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
|
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import org.mian.gitnex.R;
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.PicassoService;
|
import org.mian.gitnex.clients.PicassoService;
|
||||||
|
import org.mian.gitnex.helpers.FontsOverride;
|
||||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||||
import org.mian.gitnex.models.UserInfo;
|
import org.mian.gitnex.models.UserInfo;
|
||||||
import org.mian.gitnex.util.TinyDB;
|
import org.mian.gitnex.util.TinyDB;
|
||||||
@ -85,24 +86,19 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
|
|||||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
|
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(mCtx.getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,24 +58,20 @@ public class ProfileFragment extends Fragment {
|
|||||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||||
|
|
||||||
Typeface myTypeface;
|
Typeface myTypeface;
|
||||||
if(tinyDb.getInt("customFontId") == 0) {
|
|
||||||
|
|
||||||
|
switch(tinyDb.getInt("customFontId")) {
|
||||||
|
|
||||||
|
case 0:
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/roboto.ttf");
|
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/roboto.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
case 2:
|
||||||
else if (tinyDb.getInt("customFontId") == 1) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/manroperegular.ttf");
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (tinyDb.getInt("customFontId") == 2) {
|
|
||||||
|
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/sourcecodeproregular.ttf");
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
default:
|
||||||
else {
|
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/manroperegular.ttf");
|
||||||
|
break;
|
||||||
myTypeface = Typeface.createFromAsset(Objects.requireNonNull(getContext()).getAssets(), "fonts/roboto.ttf");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user