App wide UI changes and refactors (#630)
Enhance and update the buttons across the app, colorful animation on tap update toasty in view models update toasty in fragments update toasty in actions, activities, adapters Alert dialogs buttons arrangements strings fixes switch to fab buttons remove snackbar Enhance whole app UI, bring consistency among the elements Co-authored-by: M M Arif <mmarif@swatian.com> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/630
This commit is contained in:
@@ -26,12 +26,10 @@ public class BottomSheetAdminUsersFragment extends BottomSheetDialogFragment {
|
||||
|
||||
TextView createNewUser = v.findViewById(R.id.createNewUser);
|
||||
|
||||
createNewUser.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
bmListener.onButtonClicked("newUser");
|
||||
dismiss();
|
||||
}
|
||||
createNewUser.setOnClickListener(v1 -> {
|
||||
|
||||
bmListener.onButtonClicked("newUser");
|
||||
dismiss();
|
||||
});
|
||||
|
||||
return v;
|
||||
@@ -47,9 +45,9 @@ public class BottomSheetAdminUsersFragment extends BottomSheetDialogFragment {
|
||||
|
||||
try {
|
||||
bmListener = (BottomSheetAdminUsersFragment.BottomSheetListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement BottomSheetListener");
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ public class BottomSheetFileViewerFragment extends BottomSheetDialogFragment {
|
||||
|
||||
try {
|
||||
bmListener = (BottomSheetFileViewerFragment.BottomSheetListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement BottomSheetListener");
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,10 @@ public class BottomSheetProfileFragment extends BottomSheetDialogFragment {
|
||||
|
||||
TextView addNewEmailAddress = v.findViewById(R.id.addNewEmailAddress);
|
||||
|
||||
addNewEmailAddress.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getContext(), ProfileEmailActivity.class));
|
||||
dismiss();
|
||||
}
|
||||
addNewEmailAddress.setOnClickListener(v1 -> {
|
||||
|
||||
startActivity(new Intent(getContext(), ProfileEmailActivity.class));
|
||||
dismiss();
|
||||
});
|
||||
|
||||
return v;
|
||||
|
||||
@@ -162,9 +162,9 @@ public class BottomSheetRepoFragment extends BottomSheetDialogFragment {
|
||||
|
||||
try {
|
||||
bmListener = (BottomSheetListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement BottomSheetListener");
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString() + " must implement BottomSheetListener");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,59 +85,39 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
|
||||
}
|
||||
|
||||
mergePullRequest.setOnClickListener(new View.OnClickListener() {
|
||||
mergePullRequest.setOnClickListener(v13 -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(ctx, MergePullRequestActivity.class));
|
||||
dismiss();
|
||||
|
||||
startActivity(new Intent(ctx, MergePullRequestActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
openFilesDiff.setOnClickListener(new View.OnClickListener() {
|
||||
openFilesDiff.setOnClickListener(v14 -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(ctx, FileDiffActivity.class));
|
||||
dismiss();
|
||||
|
||||
startActivity(new Intent(ctx, FileDiffActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
editIssue.setOnClickListener(new View.OnClickListener() {
|
||||
editIssue.setOnClickListener(v15 -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(ctx, EditIssueActivity.class));
|
||||
dismiss();
|
||||
|
||||
startActivity(new Intent(ctx, EditIssueActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
editLabels.setOnClickListener(new View.OnClickListener() {
|
||||
editLabels.setOnClickListener(v16 -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(ctx, AddRemoveLabelsActivity.class));
|
||||
dismiss();
|
||||
|
||||
startActivity(new Intent(ctx, AddRemoveLabelsActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
addRemoveAssignees.setOnClickListener(new View.OnClickListener() {
|
||||
addRemoveAssignees.setOnClickListener(v17 -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(ctx, AddRemoveAssigneesActivity.class));
|
||||
dismiss();
|
||||
|
||||
startActivity(new Intent(ctx, AddRemoveAssigneesActivity.class));
|
||||
dismiss();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
shareIssue.setOnClickListener(v1 -> {
|
||||
|
||||
@@ -122,11 +122,11 @@ public class DraftsFragment extends Fragment {
|
||||
DraftsApi.deleteAllDrafts(accountId);
|
||||
draftsList_.clear();
|
||||
adapter.notifyDataSetChanged();
|
||||
Toasty.info(ctx, getResources().getString(R.string.draftsDeleteSuccess));
|
||||
Toasty.success(ctx, getResources().getString(R.string.draftsDeleteSuccess));
|
||||
|
||||
}
|
||||
else {
|
||||
Toasty.error(ctx, getResources().getString(R.string.draftsListEmpty));
|
||||
Toasty.warning(ctx, getResources().getString(R.string.draftsListEmpty));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public class IssuesFragment extends Fragment {
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.info(context, getString(R.string.noMoreData));
|
||||
Toasty.warning(context, getString(R.string.noMoreData));
|
||||
adapter.setMoreDataAvailable(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -23,6 +22,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||
import org.mian.gitnex.adapters.MyReposListAdapter;
|
||||
@@ -45,7 +45,7 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private MyReposListAdapter adapter;
|
||||
private ImageView createNewRepo;
|
||||
private ExtendedFloatingActionButton createNewRepo;
|
||||
private TextView noDataMyRepo;
|
||||
|
||||
private int pageSize = 1;
|
||||
@@ -105,15 +105,10 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
mRecyclerView.addItemDecoration(dividerItemDecoration);
|
||||
|
||||
createNewRepo = v.findViewById(R.id.addNewRepo);
|
||||
createNewRepo.setOnClickListener(new View.OnClickListener() {
|
||||
createNewRepo.setOnClickListener(view -> {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
}
|
||||
Intent intent = new Intent(view.getContext(), CreateRepoActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
});
|
||||
|
||||
@@ -135,18 +130,11 @@ public class MyRepositoriesFragment extends Fragment {
|
||||
}
|
||||
});
|
||||
|
||||
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
swipeRefresh.setRefreshing(false);
|
||||
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, getContext(), pageSize, resultLimit);
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
});
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, getContext(), pageSize, resultLimit);
|
||||
}, 50));
|
||||
|
||||
fetchDataAsync(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin, pageSize, resultLimit);
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -21,6 +19,7 @@ import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.actions.NotificationsActions;
|
||||
@@ -29,9 +28,9 @@ import org.mian.gitnex.adapters.NotificationsAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.AppUtil;
|
||||
import org.mian.gitnex.helpers.InfiniteScrollListener;
|
||||
import org.mian.gitnex.helpers.SnackBar;
|
||||
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
||||
import org.mian.gitnex.helpers.TinyDB;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.models.NotificationThread;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -52,9 +51,8 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
private NotificationsAdapter notificationsAdapter;
|
||||
private NotificationsActions notificationsActions;
|
||||
|
||||
private ImageView markAllAsRead;
|
||||
private ExtendedFloatingActionButton markAllAsRead;
|
||||
private ProgressBar progressBar;
|
||||
private RelativeLayout mainLayout;
|
||||
private ProgressBar loadingMoreView;
|
||||
private TextView noDataNotifications;
|
||||
private SwipeRefreshLayout pullToRefresh;
|
||||
@@ -88,7 +86,6 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
pageResultLimit = StaticGlobalVariables.getCurrentResultLimit(context);
|
||||
tinyDB.putString("notificationsFilterState", currentFilterMode);
|
||||
|
||||
mainLayout = v.findViewById(R.id.mainLayout);
|
||||
markAllAsRead = v.findViewById(R.id.markAllAsRead);
|
||||
noDataNotifications = v.findViewById(R.id.noDataNotifications);
|
||||
loadingMoreView = v.findViewById(R.id.loadingMoreView);
|
||||
@@ -150,7 +147,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
|
||||
activity.runOnUiThread(() -> {
|
||||
|
||||
SnackBar.info(context, mainLayout, getString(R.string.markedNotificationsAsRead));
|
||||
Toasty.success(context, getString(R.string.markedNotificationsAsRead));
|
||||
loadNotifications(true);
|
||||
|
||||
});
|
||||
@@ -158,7 +155,7 @@ public class NotificationsFragment extends Fragment implements NotificationsAdap
|
||||
}
|
||||
catch(IOException e) {
|
||||
|
||||
activity.runOnUiThread(() -> SnackBar.error(context, mainLayout, getString(R.string.genericError)));
|
||||
activity.runOnUiThread(() -> Toasty.error(context, getString(R.string.genericError)));
|
||||
Log.e("onError", e.toString());
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -22,6 +21,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateOrganizationActivity;
|
||||
import org.mian.gitnex.adapters.OrganizationsListAdapter;
|
||||
@@ -42,7 +42,7 @@ public class OrganizationsFragment extends Fragment {
|
||||
private ProgressBar mProgressBar;
|
||||
private OrganizationsListAdapter adapter;
|
||||
private RecyclerView mRecyclerView;
|
||||
private ImageView createNewOrganization;
|
||||
private ExtendedFloatingActionButton createNewOrganization;
|
||||
private TextView noDataOrg;
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -456,7 +456,7 @@ public class RepoInfoFragment extends Fragment {
|
||||
|
||||
} else if (response.code() == 403) {
|
||||
|
||||
Toasty.info(ctx, ctx.getString(R.string.authorizeError));
|
||||
Toasty.error(ctx, ctx.getString(R.string.authorizeError));
|
||||
|
||||
} else if (response.code() == 404) {
|
||||
|
||||
@@ -465,7 +465,7 @@ public class RepoInfoFragment extends Fragment {
|
||||
|
||||
} else {
|
||||
|
||||
Toasty.info(getContext(), getString(R.string.genericError));
|
||||
Toasty.error(getContext(), getString(R.string.genericError));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -22,6 +21,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||
import org.mian.gitnex.adapters.ReposListAdapter;
|
||||
@@ -42,7 +42,7 @@ public class RepositoriesFragment extends Fragment {
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private ReposListAdapter adapter;
|
||||
private ImageView createNewRepo;
|
||||
private ExtendedFloatingActionButton createNewRepo;
|
||||
private TextView noDataRepo;
|
||||
private int pageSize = 1;
|
||||
private int resultLimit = 50;
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -23,6 +22,7 @@ import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.CreateRepoActivity;
|
||||
import org.mian.gitnex.adapters.StarredReposListAdapter;
|
||||
@@ -45,7 +45,7 @@ public class StarredRepositoriesFragment extends Fragment {
|
||||
private ProgressBar mProgressBar;
|
||||
private RecyclerView mRecyclerView;
|
||||
private StarredReposListAdapter adapter;
|
||||
private ImageView createNewRepo;
|
||||
private ExtendedFloatingActionButton createNewRepo;
|
||||
private TextView noData;
|
||||
private int pageSize = 1;
|
||||
private int resultLimit = 50;
|
||||
|
||||
Reference in New Issue
Block a user