Android First attempt at improving welcome #27

This commit is contained in:
mhutti1 2016-08-04 21:01:35 +01:00
parent e6bed95491
commit d214ef2382
5 changed files with 81 additions and 34 deletions

View File

@ -6,6 +6,7 @@ NEW: Download manager
NEW: Improved ZIM management NEW: Improved ZIM management
NEW: Build against newer version of Android NDK/SDK NEW: Build against newer version of Android NDK/SDK
NEW: Bookmarks for multiple articles with the same title can be created NEW: Bookmarks for multiple articles with the same title can be created
NEW: Splash Screen and improved Welcome Screen
FIXED: Opening problem with ZIM filenames with special characters FIXED: Opening problem with ZIM filenames with special characters
FIXED: Useless "w820dp" language FIXED: Useless "w820dp" language
FIXED: Failing he, id, yi locales FIXED: Failing he, id, yi locales

View File

@ -12,7 +12,6 @@ body {
font-family: georgia,times new roman,serif; font-family: georgia,times new roman,serif;
color: #666666; color: #666666;
font-size: 90%; font-size: 90%;
background: none repeat scroll 0 0 #EEF8FB;
} }
h1, h2 { h1, h2 {
@ -87,9 +86,10 @@ a.button:hover {
} }
img { img {
width: 30%; width: 80%;
max-width: 100px; display: block;
float: right; margin: auto;
padding: 0.4em;
} }
div.alert { div.alert {

View File

@ -11,45 +11,71 @@
</head> </head>
<body class="welcome" lang="en-US"> <body class="welcome" lang="en-US">
<img src="file:///android_res/drawable/splash_screen.png"/>
<a class="button" href="content://org.kiwix.ui/selectzimfile">Get Content</a>
<div id="content-wrapper"> <div id="content-wrapper">
<section id="step1"> <section id="step1">
<h2><span>1.</span> Download Offline Files</h2> <p><strong>Kiwix</strong> allows you offline access to websites such as Wikipedia in a highly compressed form.
</section>
<section id="what-does-kiwix-do">
<h2>What does Kiwix do?</h2>
<p><strong>Kiwix</strong> allows to read websites like Wikipedia off-line. Try our 2.4MB <p><em>Kiwix</em> is an offline content reader. It acts very much like a browser but instead
Wikipedia demo file containing a few articles about singer <em>Ray Charles</em> from the of accessing <em>online web pages</em>, it reads content from a file in <em>ZIM
English Wikipedia:</p> format</em>.</p>
<a class="button" href="http://download.kiwix.org/zim/wikipedia_en_ray_charles.zim">Ray-Charles-Demo.zim</a>
<p>Offline content is available at <a href="http://www.kiwix.org/m/">kiwix.org</a>. You can <p>While Kiwix has been originaly designed to provide Wikipedia offline, it also reads other
create your own books in Wikipedia, refer to the <a contents.</p>
href="content://org.kiwix.ui/gotohelp">help</a> for further details.</p>
<div class="alert alert-info"><strong>Warning!</strong> This download will take place in
your browser. Don't forget to come back to Kiwix once download is complete!
</div>
</section> </section>
<section id="step2"> <section id="where-do-i-find-content">
<h2><span>2.</span> Take a drink break!</h2> <h2>Where is the content?</h2>
<img src="coffee.png">
<p>Downloads can take a long time, go mind your regular business and come back once <p>Our content is hosted on the <a href="http://kiwix.org/m/">kiwix website</a>.</p>
done.</p>
<p>They are available as ZIM files. There are <strong>a lot</strong> of them:</p>
<ul>
<li>Wikipedia is available separately for each language</li>
<li>Other contents like Wikileaks or Wikisource are also available</li>
</ul>
<p>You can either download your choosen ZIM files in-app or carefuly select the one(s) you want and
download from a Desktop computer before transfering the ZIM files to your SD card.</p>
<p>ZIM files download in-app are located in the external storage directory in a folder entitled Kiwix.</p>
</section> </section>
<section id="step3"> <section id="large-zim">
<h2><span>3.</span> Open the file in Kiwix!</h2> <h2>How to use large ZIM files?</h2>
<p>Click the <span><a href="content://org.kiwix.ui/selectzimfile">Open File</a></span> <p>If your ZIM file is larger than 4GB, you might not be able to store it on your SD card
button in the toolbar at the top and select the ZIM file you downloaded. <strong>That's due to filesystem limitations.</p>
It!</strong></p>
<p>Now, enjoy your content, and take a look at the <a <p>Downloading in-app automaticaly handles larger files, splitting them up for you.
href="content://org.kiwix.ui/gotohelp">help</a> page once bored.</p>
<p>If however you are downloading on another device, you may need to split the ZIM file up using the fololwing software:</p>
<ul>
<li> On Microsoft Windows: <a rel="nofollow" class="external text"
href="http://www.hjsplit.org/">HJ-Split</a>
</li>
<li> On Apple Mac OSX: <a rel="nofollow" class="external text"
href="http://loekjehe.home.xs4all.nl/Split&amp;Concat/">Split&amp;Concat</a>
</li>
<li> On GNU/Linux and with the console: <code>split --bytes=4000M my_big_file.zim</code>
</li>
</ul>
<p><strong>Note:</strong> your resulting files must be named <code>my_big_file.zimaa</code>,
<code>my_big_file.zimab</code>, etc.</p>
</section> </section>
<section id="intro">
<h1>Thank you for choosing Kiwix!</h1>
<p>We are glad to have you on board and would appreciate any feedback or suggestions.</p>
</section>
</div> </div>
<script src="file:///android_asset/www/jquery.js"></script> <script src="file:///android_asset/www/jquery.js"></script>

View File

@ -80,6 +80,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import org.json.JSONArray; import org.json.JSONArray;
import org.kiwix.kiwixmobile.database.BookmarksDao; import org.kiwix.kiwixmobile.database.BookmarksDao;
import org.kiwix.kiwixmobile.database.KiwixDatabase; import org.kiwix.kiwixmobile.database.KiwixDatabase;
@ -454,7 +455,6 @@ public class KiwixMobileActivity extends AppCompatActivity {
loadPrefs(); loadPrefs();
updateTitle(ZimContentProvider.getZimFileTitle()); updateTitle(ZimContentProvider.getZimFileTitle());
if (IS_WIDGET_STAR && ZimContentProvider.getId() != null) { if (IS_WIDGET_STAR && ZimContentProvider.getId() != null) {
goToBookmarks(); goToBookmarks();
} else if (IS_WIDGET_SEARCH_INTENT && ZimContentProvider.getId() != null) { } else if (IS_WIDGET_SEARCH_INTENT && ZimContentProvider.getId() != null) {
@ -920,7 +920,8 @@ public class KiwixMobileActivity extends AppCompatActivity {
// Load from resource. Use with base url as else no images can be embedded. // Load from resource. Use with base url as else no images can be embedded.
// Note that this leads inclusion of welcome page in browser history // Note that this leads inclusion of welcome page in browser history
// This is not perfect, but good enough. (and would be significant effort to remove file) // This is not perfect, but good enough. (and would be significant effort to remove file)
getCurrentWebView().loadUrl("file:///android_res/raw/help.html"); newTab();
getCurrentWebView().loadUrl("file:///android_res/raw/welcome.html");
} }
} }
@ -1540,6 +1541,22 @@ public class KiwixMobileActivity extends AppCompatActivity {
startActivityForResult(target, REQUEST_FILE_SELECT); startActivityForResult(target, REQUEST_FILE_SELECT);
} }
public void downloadZimFiles() {
refreshBookmarks();
final Intent target = new Intent(this, ZimManageActivity.class);
target.setAction(Intent.ACTION_GET_CONTENT);
target.putExtra(ZimManageActivity.TAB_EXTRA,1);
// The MIME data type filter
target.setType("//");
// Only return URIs that can be opened with ContentResolver
target.addCategory(Intent.CATEGORY_OPENABLE);
// Force use of our file selection component.
// (Note may make sense to just define a custom intent instead)
startActivityForResult(target, REQUEST_FILE_SELECT);
}
public void selectSettings() { public void selectSettings() {
final String zimFile = ZimContentProvider.getZimFile(); final String zimFile = ZimContentProvider.getZimFile();
Intent i = new Intent(this, KiwixSettingsActivity.class); Intent i = new Intent(this, KiwixSettingsActivity.class);
@ -1761,9 +1778,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
} else if (url.startsWith(ZimContentProvider.UI_URI.toString())) { } else if (url.startsWith(ZimContentProvider.UI_URI.toString())) {
// To handle links which access user interface (i.p. used in help page) // To handle links which access user interface (i.p. used in help page)
if (url.equals(ZimContentProvider.UI_URI.toString() + "selectzimfile")) { if (url.equals(ZimContentProvider.UI_URI.toString() + "selectzimfile")) {
manageZimFiles(); downloadZimFiles();
} else if (url.equals(ZimContentProvider.UI_URI.toString() + "gotohelp")) {
showHelp();
} else { } else {
Log.e(TAG_KIWIX, "UI Url " + url + " not supported."); Log.e(TAG_KIWIX, "UI Url " + url + " not supported.");
} }

View File

@ -56,6 +56,8 @@ public class ZimManageActivity extends AppCompatActivity {
public boolean downloading = false; public boolean downloading = false;
public static final String TAB_EXTRA = "TAB";
private Menu mMenu; private Menu mMenu;
@ -77,6 +79,9 @@ public class ZimManageActivity extends AppCompatActivity {
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs); TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager); tabLayout.setupWithViewPager(mViewPager);
getIntent().getIntExtra(TAB_EXTRA,0);
mViewPager.setCurrentItem(getIntent().getIntExtra(TAB_EXTRA,0));
} }
private void setUpToolbar() { private void setUpToolbar() {