mirror of
https://github.com/gitnex-org/gitnex.git
synced 2026-04-26 19:18:14 -05:00
Fix account settings UI
This commit is contained in:
@@ -545,9 +545,6 @@ public class MainActivity extends BaseActivity
|
||||
switch (Integer.parseInt(
|
||||
AppDatabaseSettings.getSettingsValue(
|
||||
this, AppDatabaseSettings.APP_HOME_SCREEN_KEY))) {
|
||||
case 0:
|
||||
navController.navigate(R.id.homeDashboardFragment, null, navOptions);
|
||||
break;
|
||||
case 1:
|
||||
binding.toolbarTitle.setText(getResources().getString(R.string.navMyRepos));
|
||||
navController.navigate(R.id.nav_graph, null, navOptions);
|
||||
@@ -604,7 +601,7 @@ public class MainActivity extends BaseActivity
|
||||
public void getNotificationsCount() {
|
||||
Call<NotificationCount> call = RetrofitClient.getApiInterface(this).notifyNewAvailable();
|
||||
call.enqueue(
|
||||
new Callback<NotificationCount>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(
|
||||
@NonNull Call<NotificationCount> call,
|
||||
@@ -640,7 +637,7 @@ public class MainActivity extends BaseActivity
|
||||
public void giteaVersion() {
|
||||
Call<ServerVersion> call = RetrofitClient.getApiInterface(this).getVersion();
|
||||
call.enqueue(
|
||||
new Callback<ServerVersion>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(
|
||||
@NonNull Call<ServerVersion> call,
|
||||
@@ -676,7 +673,7 @@ public class MainActivity extends BaseActivity
|
||||
Call<GeneralAPISettings> call =
|
||||
RetrofitClient.getApiInterface(this).getGeneralAPISettings();
|
||||
call.enqueue(
|
||||
new Callback<GeneralAPISettings>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(
|
||||
@NonNull Call<GeneralAPISettings> call,
|
||||
@@ -712,7 +709,7 @@ public class MainActivity extends BaseActivity
|
||||
Call<GeneralAttachmentSettings> call =
|
||||
RetrofitClient.getApiInterface(this).getGeneralAttachmentSettings();
|
||||
call.enqueue(
|
||||
new Callback<GeneralAttachmentSettings>() {
|
||||
new Callback<>() {
|
||||
@Override
|
||||
public void onResponse(
|
||||
@NonNull Call<GeneralAttachmentSettings> call,
|
||||
@@ -744,10 +741,6 @@ public class MainActivity extends BaseActivity
|
||||
});
|
||||
}
|
||||
|
||||
public void setProfileInitListener(BottomSheetListener profileInitListener) {
|
||||
this.profileInitListener = profileInitListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp() {
|
||||
return navController.navigateUp() || super.onSupportNavigateUp();
|
||||
|
||||
@@ -15,15 +15,12 @@ import androidx.viewpager2.widget.ViewPager2;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.BaseActivity;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.helpers.AppDatabaseSettings;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.ViewPager2Transformers;
|
||||
import org.mian.gitnex.helpers.contexts.AccountContext;
|
||||
|
||||
/**
|
||||
* @author M M Arif
|
||||
* @author mmarif
|
||||
*/
|
||||
public class AccountSettingsFragment extends Fragment {
|
||||
|
||||
@@ -41,20 +38,9 @@ public class AccountSettingsFragment extends Fragment {
|
||||
ctx = getContext();
|
||||
|
||||
view = inflater.inflate(R.layout.fragment_account_settings, container, false);
|
||||
setHasOptionsMenu(false);
|
||||
|
||||
myTypeface = AppUtil.getTypeface(ctx);
|
||||
|
||||
AccountContext account = ((BaseActivity) requireActivity()).getAccount();
|
||||
if (account.getUserInfo() != null) {
|
||||
viewData();
|
||||
} else {
|
||||
((MainActivity) requireActivity())
|
||||
.setProfileInitListener(
|
||||
(text) -> {
|
||||
viewData();
|
||||
});
|
||||
}
|
||||
viewData();
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MyIssuesFragment extends Fragment {
|
||||
public void onCreateMenu(
|
||||
@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
|
||||
menuInflater.inflate(R.menu.search_menu, menu);
|
||||
menuInflater.inflate(R.menu.filter_menu, menu);
|
||||
menuInflater.inflate(R.menu.generic_nav_dotted_menu, menu);
|
||||
|
||||
MenuItem searchItem = menu.findItem(R.id.action_search);
|
||||
androidx.appcompat.widget.SearchView searchView =
|
||||
@@ -110,7 +110,7 @@ public class MyIssuesFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public boolean onMenuItemSelected(@NonNull MenuItem menuItem) {
|
||||
if (menuItem.getItemId() == R.id.filter) {
|
||||
if (menuItem.getItemId() == R.id.genericMenu) {
|
||||
new FilterBottomSheetDialogFragment()
|
||||
.show(getChildFragmentManager(), "MyIssuesFilter");
|
||||
return true;
|
||||
|
||||
@@ -1,102 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="@dimen/dimen6dp"
|
||||
android:paddingBottom="@dimen/dimen12dp">
|
||||
android:padding="@dimen/dimen16dp">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<LinearLayout
|
||||
android:id="@+id/filters_head_frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:id="@+id/filter_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:gravity="center"
|
||||
android:text="@string/strFilter"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/filtersHeadFrame"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen28dp"
|
||||
android:layout_height="@dimen/dimen4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen16dp"
|
||||
app:cardCornerRadius="@dimen/dimen24dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/fabColor" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/filterChipGroup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:chipSpacingHorizontal="@dimen/dimen8dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeTopicChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/dimen8dp">
|
||||
android:text="@string/exploreFilterIncludeTopic"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottomSheetHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/strFilter"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="@dimen/dimen16sp"/>
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="?attr/materialCardViewFilledStyle"
|
||||
android:layout_width="@dimen/dimen28dp"
|
||||
android:layout_height="@dimen/dimen4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dimen8dp"
|
||||
android:layout_marginBottom="@dimen/dimen16dp"
|
||||
app:cardCornerRadius="@dimen/dimen24dp"
|
||||
app:cardElevation="@dimen/dimen0dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/fabColor" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/filterChipGroup"
|
||||
android:layout_width="match_parent"
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeDescChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/dimen4dp"
|
||||
app:flexWrap="wrap"
|
||||
app:alignContent="center"
|
||||
app:alignItems="flex_start"
|
||||
app:justifyContent="center">
|
||||
android:text="@string/exploreFilterIncludeDesc"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeTopicChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeTopic"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeTemplateChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeTemplateRepos"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeDescChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeDesc"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/onlyArchivedChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeArchive"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/includeTemplateChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeTemplateRepos"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/onlyArchivedChip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/exploreFilterIncludeArchive"
|
||||
style="@style/CustomChipFilter"
|
||||
app:checkedIconEnabled="true" />
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user