diff --git a/app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java b/app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java index d92c8874..43c5e562 100644 --- a/app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java +++ b/app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java @@ -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); } }); diff --git a/app/src/main/res/layout/files_list.xml b/app/src/main/res/layout/files_list.xml index 1e0b113c..2319666a 100644 --- a/app/src/main/res/layout/files_list.xml +++ b/app/src/main/res/layout/files_list.xml @@ -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" diff --git a/app/src/main/res/layout/fragment_files.xml b/app/src/main/res/layout/fragment_files.xml index 9f0d3d45..d499bb0b 100644 --- a/app/src/main/res/layout/fragment_files.xml +++ b/app/src/main/res/layout/fragment_files.xml @@ -1,45 +1,68 @@ - - + android:layout_height="wrap_content" + android:orientation="vertical" + > - + + + + + + + + + android:layout_margin="15dp" + android:gravity="center" + android:text="@string/noDataFilesTab" + android:textColor="@color/white" + android:textSize="20sp" + android:visibility="gone" /> - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 263a9b40..34e0fcdd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -474,6 +474,7 @@ No files found Directory browsing is not supported yet Sorry this file cannot be viewed as API return an error + Root OK