Idea to use breadcrumb

This commit is contained in:
M M Arif 2019-10-03 20:57:49 +05:00
parent a77716970b
commit 572f93d35c
4 changed files with 56 additions and 27 deletions

View File

@ -19,6 +19,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.mian.gitnex.R;
@ -41,6 +42,7 @@ public class FilesFragment extends Fragment {
private FilesAdapter adapter;
private RecyclerView mRecyclerView;
private TextView noDataFiles;
private LinearLayout filesFrame;
private static String repoNameF = "param2";
private static String repoOwnerF = "param1";
@ -83,6 +85,7 @@ public class FilesFragment extends Fragment {
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
noDataFiles = v.findViewById(R.id.noDataFiles);
filesFrame = v.findViewById(R.id.filesFrame);
final SwipeRefreshLayout swipeRefresh = v.findViewById(R.id.pullToRefresh);
@ -124,13 +127,16 @@ public class FilesFragment extends Fragment {
adapter = new FilesAdapter(getContext(), filesListMain);
if(adapter.getItemCount() > 0) {
mRecyclerView.setAdapter(adapter);
filesFrame.setVisibility(View.VISIBLE);
noDataFiles.setVisibility(View.GONE);
}
else {
adapter.notifyDataSetChanged();
mRecyclerView.setAdapter(adapter);
filesFrame.setVisibility(View.VISIBLE);
noDataFiles.setVisibility(View.VISIBLE);
}
filesFrame.setVisibility(View.VISIBLE);
mProgressBar.setVisibility(View.GONE);
}
});

View File

@ -6,7 +6,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="0dp"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:layout_margin="10dp"

View File

@ -1,11 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context=".activities.RepoDetailActivity">
<LinearLayout
android:id="@+id/filesFrame"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/fileBrowserBreadcrumb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:textColor="@color/lightGray"
android:text="@string/filesBreadcrumb" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
@ -33,13 +54,15 @@
android:textSize="20sp"
android:visibility="gone" />
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
style="@style/Base.Widget.AppCompat.ProgressBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>

View File

@ -474,6 +474,7 @@
<string name="noDataFilesTab">No files found</string>
<string name="filesDirNotSupportedYet">Directory browsing is not supported yet</string>
<string name="filesGenericError">Sorry this file cannot be viewed as API return an error</string>
<string name="filesBreadcrumb">Root</string>
<!-- generic copy -->
<string name="okButton">OK</string>