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:layout_height="56dp"
|
||||||
android:background="?attr/selectedBackground"
|
android:background="?attr/selectedBackground"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textTab"
|
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="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="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="go_to_play_store">Go to Play Store</string>
|
||||||
|
<string name="no_section_info">No Content Headers Found</string>
|
||||||
</resources>
|
</resources>
|
@ -298,9 +298,9 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
mRightDrawerList.setDivider(null);
|
mRightDrawerList.setDivider(null);
|
||||||
mRightDrawerList.setDividerHeight(0);
|
mRightDrawerList.setDividerHeight(0);
|
||||||
mRightDrawerList.setAdapter(mRightArrayAdapter);
|
mRightDrawerList.setAdapter(mRightArrayAdapter);
|
||||||
|
TextView tView = (TextView) findViewById(R.id.empty);
|
||||||
|
mRightDrawerList.setEmptyView(tView);
|
||||||
sectionProperties = new ArrayList<SectionProperties>();
|
sectionProperties = new ArrayList<SectionProperties>();
|
||||||
//
|
|
||||||
// +mRightDrawerList.addHeaderView(tDiddy);
|
|
||||||
mRightArrayAdapter.notifyDataSetChanged();
|
mRightArrayAdapter.notifyDataSetChanged();
|
||||||
|
|
||||||
mLeftDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
mLeftDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@ -309,6 +309,13 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
selectTab(position);
|
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,
|
final ActionBarDrawerToggle drawerToggle = new ActionBarDrawerToggle(this, mLeftDrawerLayout, toolbar,
|
||||||
0, 0){
|
0, 0){
|
||||||
|
|
||||||
@ -1523,14 +1530,6 @@ public class KiwixMobileActivity extends AppCompatActivity
|
|||||||
holder = (ViewHolder) row.getTag();
|
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())
|
if (sectionProperties.isEmpty())
|
||||||
return row;
|
return row;
|
||||||
SectionProperties section = sectionProperties.get(position);
|
SectionProperties section = sectionProperties.get(position);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user