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: Build against newer version of Android NDK/SDK
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: Useless "w820dp" language
FIXED: Failing he, id, yi locales

View File

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

View File

@ -11,45 +11,71 @@
</head>
<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">
<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
Wikipedia demo file containing a few articles about singer <em>Ray Charles</em> from the
English Wikipedia:</p>
<a class="button" href="http://download.kiwix.org/zim/wikipedia_en_ray_charles.zim">Ray-Charles-Demo.zim</a>
<p><em>Kiwix</em> is an offline content reader. It acts very much like a browser but instead
of accessing <em>online web pages</em>, it reads content from a file in <em>ZIM
format</em>.</p>
<p>Offline content is available at <a href="http://www.kiwix.org/m/">kiwix.org</a>. You can
create your own books in Wikipedia, refer to the <a
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>
<p>While Kiwix has been originaly designed to provide Wikipedia offline, it also reads other
contents.</p>
</section>
<section id="step2">
<h2><span>2.</span> Take a drink break!</h2>
<img src="coffee.png">
<section id="where-do-i-find-content">
<h2>Where is the content?</h2>
<p>Downloads can take a long time, go mind your regular business and come back once
done.</p>
<p>Our content is hosted on the <a href="http://kiwix.org/m/">kiwix website</a>.</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 id="step3">
<h2><span>3.</span> Open the file in Kiwix!</h2>
<section id="large-zim">
<h2>How to use large ZIM files?</h2>
<p>Click the <span><a href="content://org.kiwix.ui/selectzimfile">Open File</a></span>
button in the toolbar at the top and select the ZIM file you downloaded. <strong>That's
It!</strong></p>
<p>If your ZIM file is larger than 4GB, you might not be able to store it on your SD card
due to filesystem limitations.</p>
<p>Downloading in-app automaticaly handles larger files, splitting them up for you.
<p>Now, enjoy your content, and take a look at the <a
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 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>
<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.Toast;
import org.json.JSONArray;
import org.kiwix.kiwixmobile.database.BookmarksDao;
import org.kiwix.kiwixmobile.database.KiwixDatabase;
@ -454,7 +455,6 @@ public class KiwixMobileActivity extends AppCompatActivity {
loadPrefs();
updateTitle(ZimContentProvider.getZimFileTitle());
if (IS_WIDGET_STAR && ZimContentProvider.getId() != null) {
goToBookmarks();
} 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.
// 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)
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);
}
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() {
final String zimFile = ZimContentProvider.getZimFile();
Intent i = new Intent(this, KiwixSettingsActivity.class);
@ -1761,9 +1778,7 @@ public class KiwixMobileActivity extends AppCompatActivity {
} else if (url.startsWith(ZimContentProvider.UI_URI.toString())) {
// To handle links which access user interface (i.p. used in help page)
if (url.equals(ZimContentProvider.UI_URI.toString() + "selectzimfile")) {
manageZimFiles();
} else if (url.equals(ZimContentProvider.UI_URI.toString() + "gotohelp")) {
showHelp();
downloadZimFiles();
} else {
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 static final String TAB_EXTRA = "TAB";
private Menu mMenu;
@ -77,6 +79,9 @@ public class ZimManageActivity extends AppCompatActivity {
TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(mViewPager);
getIntent().getIntExtra(TAB_EXTRA,0);
mViewPager.setCurrentItem(getIntent().getIntExtra(TAB_EXTRA,0));
}
private void setUpToolbar() {