Set notifications as home srceen (#644)
This commit is contained in:
		| @@ -319,6 +319,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig | ||||
|  | ||||
| 		if(savedInstanceState == null) { | ||||
|  | ||||
| 			if(!new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.3")) { | ||||
|  | ||||
| 				if(tinyDb.getInt("homeScreenId") == 7) { | ||||
|  | ||||
| 					tinyDb.putInt("homeScreenId", 0); | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			switch(tinyDb.getInt("homeScreenId")) { | ||||
|  | ||||
| 				case 1: | ||||
| @@ -357,6 +365,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig | ||||
| 					navigationView.setCheckedItem(R.id.nav_comments_draft); | ||||
| 					break; | ||||
|  | ||||
| 				case 7: | ||||
| 					toolbarTitle.setText(getResources().getString(R.string.pageTitleNotifications)); | ||||
| 					getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new NotificationsFragment()).commit(); | ||||
| 					navigationView.setCheckedItem(R.id.nav_notifications); | ||||
| 					break; | ||||
|  | ||||
| 				default: | ||||
| 					toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos)); | ||||
| 					getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit(); | ||||
|   | ||||
| @@ -11,6 +11,7 @@ import androidx.appcompat.app.AlertDialog; | ||||
| import org.mian.gitnex.R; | ||||
| import org.mian.gitnex.helpers.TinyDB; | ||||
| import org.mian.gitnex.helpers.Toasty; | ||||
| import org.mian.gitnex.helpers.Version; | ||||
|  | ||||
| /** | ||||
|  * Author M M Arif | ||||
| @@ -28,6 +29,7 @@ public class SettingsAppearanceActivity extends BaseActivity { | ||||
| 	private static int codeBlockSelectedChoice = 0; | ||||
|  | ||||
| 	private static String[] homeScreenList = {"My Repositories", "Starred Repositories", "Organizations", "Repositories", "Profile", "Explore", "Drafts"}; | ||||
| 	private static String[] homeScreenListNew = {"My Repositories", "Starred Repositories", "Organizations", "Repositories", "Profile", "Explore", "Drafts",  "Notifications"}; | ||||
| 	private static int homeScreenSelectedChoice = 0; | ||||
|  | ||||
| 	private static String[] customFontList = {"Roboto", "Manrope", "Source Code Pro"}; | ||||
| @@ -69,6 +71,11 @@ public class SettingsAppearanceActivity extends BaseActivity { | ||||
| 		initCloseListener(); | ||||
| 		closeActivity.setOnClickListener(onClickListener); | ||||
|  | ||||
| 		if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.3")) { | ||||
|  | ||||
| 			homeScreenList = homeScreenListNew; | ||||
| 		} | ||||
|  | ||||
| 		if(!tinyDb.getString("timeStr").isEmpty()) { | ||||
| 			tvDateTimeSelected.setText(tinyDb.getString("timeStr")); | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user