diff --git a/res/layout/section_list.xml b/res/layout/section_list.xml index d1e4bbaa6..2a2977edd 100644 --- a/res/layout/section_list.xml +++ b/res/layout/section_list.xml @@ -4,7 +4,9 @@ android:layout_height="56dp" android:background="?attr/selectedBackground" android:gravity="center_vertical" - android:orientation="horizontal"> + android:orientation="horizontal" + android:clickable="false" + android:focusable="false"> Could not find an installed application for this type of file Your application is corrupted.\nThis might happen when you remove files on the SD Card.\nYou need to uninstall then reinstall the App from the Play Store. Go to Play Store + No Content Headers Found \ No newline at end of file diff --git a/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java b/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java index 9aa97b7c4..eb2f30399 100644 --- a/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java +++ b/src/org/kiwix/kiwixmobile/KiwixMobileActivity.java @@ -298,9 +298,9 @@ public class KiwixMobileActivity extends AppCompatActivity mRightDrawerList.setDivider(null); mRightDrawerList.setDividerHeight(0); mRightDrawerList.setAdapter(mRightArrayAdapter); + TextView tView = (TextView) findViewById(R.id.empty); + mRightDrawerList.setEmptyView(tView); sectionProperties = new ArrayList(); - // - // +mRightDrawerList.addHeaderView(tDiddy); mRightArrayAdapter.notifyDataSetChanged(); mLeftDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @@ -309,6 +309,13 @@ public class KiwixMobileActivity extends AppCompatActivity selectTab(position); } }); + mRightDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + getCurrentWebView().loadUrl("javascript:document.getElementById('" + sectionProperties.get(position - mRightDrawerList.getHeaderViewsCount()).sectionId+ "').scrollIntoView();"); + mRightDrawerLayout.closeDrawers(); + } + }); final ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, mLeftDrawerLayout, toolbar, 0, 0){ @@ -1178,7 +1185,7 @@ public class KiwixMobileActivity extends AppCompatActivity String zimArticles = settings.getString(TAG_CURRENT_ARTICLES, null); String zimPositions = settings.getString(TAG_CURRENT_POSITIONS, null); int currentTab = settings.getInt(TAG_CURRENT_TAB, 0 ); - openZimFile( new File(zimFile), false); + openZimFile(new File(zimFile), false); try { JSONArray urls = new JSONArray(zimArticles); JSONArray positions = new JSONArray(zimPositions); @@ -1523,14 +1530,6 @@ public class KiwixMobileActivity extends AppCompatActivity holder = (ViewHolder) row.getTag(); } - holder.txtTitle.setOnClickListener(new View.OnClickListener() { - - @Override - public void onClick(View view) { - getCurrentWebView().loadUrl("javascript:document.getElementById('" + sectionProperties.get(position).sectionId + "').scrollIntoView();"); - mRightDrawerLayout.closeDrawers(); - } - }); if (sectionProperties.isEmpty()) return row; SectionProperties section = sectionProperties.get(position);