mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Improved table of contents UI on android
This commit is contained in:
parent
a3635a2541
commit
2bc9ad320d
@ -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">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textTab"
|
||||
|
@ -53,4 +53,5 @@
|
||||
<string name="no_reader_application_installed">Could not find an installed application for this type of file</string>
|
||||
<string name="customapp_missing_content">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.</string>
|
||||
<string name="go_to_play_store">Go to Play Store</string>
|
||||
<string name="no_section_info">No Content Headers Found</string>
|
||||
</resources>
|
@ -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<SectionProperties>();
|
||||
//
|
||||
// +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){
|
||||
|
||||
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user