Merge pull request #31 from kevmeyer/rss-feed

fixes for release
This commit is contained in:
tcitworld 2014-08-20 12:11:37 +02:00
commit 101b3caa32
8 changed files with 108 additions and 33 deletions

View File

@ -7,6 +7,7 @@ import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuInflater; import android.view.MenuInflater;
@ -24,6 +25,15 @@ public class ListArticles extends Activity {
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.list); setContentView(R.layout.list);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
try {
getActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception e) {
//
}
}
setupDB(); setupDB();
setupList(false); setupList(false);
} }
@ -55,7 +65,10 @@ public class ListArticles extends Activity {
ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(this); ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(this);
helper.truncateTables(database); helper.truncateTables(database);
setupList(false); setupList(false);
super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
case android.R.id.home:
this.finish();
return super.onOptionsItemSelected(item);
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }

View File

@ -84,6 +84,7 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_DATE;
Button btnDone; Button btnDone;
Button btnGetPost; Button btnGetPost;
Button btnSync; Button btnSync;
Button btnSettings;
EditText editPocheUrl; EditText editPocheUrl;
SharedPreferences settings; SharedPreferences settings;
static String apiUsername; static String apiUsername;
@ -91,9 +92,8 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_DATE;
static String pocheUrl; static String pocheUrl;
String action; String action;
/** Called when the activity is first created. /** Called when the activity is first created.
@ -195,7 +195,14 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_DATE;
startActivity(new Intent(getBaseContext(), ListArticles.class)); startActivity(new Intent(getBaseContext(), ListArticles.class));
} }
}); });
btnSettings = (Button)findViewById(R.id.btnSettings);
btnSettings.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getBaseContext(), Settings.class));
}
});
} }
} }
@ -236,23 +243,6 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_DATE;
} }
} }
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.option, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menuSettings:
startActivity(new Intent(getBaseContext(), Settings.class));
default:
return super.onOptionsItemSelected(item);
}
}
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
@ -268,7 +258,7 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_DATE;
ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext()); ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext());
database = helper.getReadableDatabase(); database = helper.getReadableDatabase();
int news = database.query(ARTICLE_TABLE, null, ARCHIVE + "=0", null, null, null, null).getCount(); int news = database.query(ARTICLE_TABLE, null, ARCHIVE + "=0", null, null, null, null).getCount();
btnGetPost.setText(getString(R.string.btnGetPost) + " - " + news + " unread"); btnGetPost.setText(String.format(getString(R.string.btnGetPost), news));
} }
}); });
} }

View File

@ -14,7 +14,9 @@ import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
@ -43,6 +45,15 @@ public class ReadArticle extends Activity {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
requestWindowFeature(Window.FEATURE_PROGRESS); requestWindowFeature(Window.FEATURE_PROGRESS);
setContentView(R.layout.article); setContentView(R.layout.article);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
try {
getActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception e) {
//
}
}
view = (ScrollView) findViewById(R.id.scroll); view = (ScrollView) findViewById(R.id.scroll);
ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext()); ArticlesSQLiteOpenHelper helper = new ArticlesSQLiteOpenHelper(getApplicationContext());
database = helper.getWritableDatabase(); database = helper.getWritableDatabase();
@ -137,5 +148,15 @@ public class ReadArticle extends Activity {
super.onDestroy(); super.onDestroy();
database.close(); database.close();
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
this.finish();
return super.onOptionsItemSelected(item);
default:
return super.onOptionsItemSelected(item);
}
}
} }

View File

@ -4,7 +4,9 @@ import static fr.gaulupeau.apps.Poche.Helpers.PREFS_NAME;
import fr.gaulupeau.apps.InThePoche.R; import fr.gaulupeau.apps.InThePoche.R;
import android.app.Activity; import android.app.Activity;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Button; import android.widget.Button;
@ -23,6 +25,15 @@ public class Settings extends Activity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.settings); setContentView(R.layout.settings);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
try {
getActionBar().setDisplayHomeAsUpEnabled(true);
} catch (Exception e) {
//
}
}
SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);
String pocheUrl = settings.getString("pocheUrl", "http://"); String pocheUrl = settings.getString("pocheUrl", "http://");
String apiUsername = settings.getString("APIUsername", ""); String apiUsername = settings.getString("APIUsername", "");
@ -52,4 +63,15 @@ public class Settings extends Activity {
// //
} }
} }
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
this.finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
} }

View File

@ -30,7 +30,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/hello" android:text="@string/hello"
android:textSize="25sp" /> android:textSize="25sp"
android:visibility="gone" />
<View <View
android:id="@+id/view1" android:id="@+id/view1"
@ -55,6 +56,13 @@
android:layout_weight="1" android:layout_weight="1"
android:text="@string/btnSync" /> android:text="@string/btnSync" />
<Button
android:id="@+id/btnSettings"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/btnSettings"/>
<ProgressBar <ProgressBar
android:id="@+id/progressBar1" android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge" style="?android:attr/progressBarStyleLarge"

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/menuSettings"
android:icon="@android:drawable/ic_menu_preferences" android:enabled="true" android:menuCategory="system" android:visible="true" android:title="@string/menuSettings"/>
</menu>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Wilkommen!</string>
<string name="app_name">wallabag</string>
<string name="label_name">Bag it!</string>
<string name="author">GAULUPEAU Jonathan - 2013</string>
<string name="instructions">Um eine Website zu speichern benutze einfach den <i>Teilen</i> Button deines Browsers und drücke dann auf <i>Bag it!</i>.\nDann wirst du zur Login-Seite deiner wallabag weitergeleitet. \nFertig!\nErfahre mehr über wallabag auf:\n http://www.wallabag.org</string>
<string name="btnDone">Speichern</string>
<string name="which_browser">Welchen Browser möchtest du benutzen?</string>
<string name="authorSite">http://cv.gaulupeau.fr</string>
<string name="url_label"><b><u>Deine wallabag URL:</u></b></string>
<string name="url_help">Beispiele:\n<i>http://wallabag.example.com</i>\n<i>http://www.example.com/wallabag</i></string>
<string name="btnGetPost">Artikelliste - %1$d ungelesene</string>
<string name="btnSync">Synchronisieren</string>
<string name="btnMarkRead">Als gelesen markieren</string>
<string name="btnSettings">Einstellungen</string>
<string name="menuShowAll">Alle anzeigen</string>
<string name="menuWipeDb">Datenbank leeren</string>
<string name="txtSyncDone">Synchronisieren erfolgreich!</string>
<string name="txtSyncFailed">Synchronisieren fehlgeschlagen!</string>
<string name="txtNetOffline">Internetverbindung prüfen!</string>
<string name="txtConfigNotSet">Bitte konfiguriere die App zunächst!</string>
<string name="txtGlobalToken"><b><u>Globales API Token:</u></b></string>
<string name="txtAPIUsername"><b><u>Deine User ID:</u></b></string>
<string name="txtAPIToken"><b><u>Dein Token:</u></b></string>
</resources>

View File

@ -4,16 +4,16 @@
<string name="app_name">wallabag</string> <string name="app_name">wallabag</string>
<string name="label_name">Bag it!</string> <string name="label_name">Bag it!</string>
<string name="author">GAULUPEAU Jonathan - 2013</string> <string name="author">GAULUPEAU Jonathan - 2013</string>
<string name="instructions">To save a web page to wallabag, open the page in a browser then tap <i>Share</i> and tap on <i>Bag it!</i>. \nYou could then see your wallabag login page. \nAnd it\'s done ! \nMore infos about wallabag at http://www.wallabag.org</string> <string name="instructions">To save a web page to wallabag, open the page in a browser then tap <i>Share</i> and tap on <i>Bag it!</i>. \nYou could then see your wallabag login page. \nAnd it\'s done ! \nMore infos about wallabag at:\n http://www.wallabag.org</string>
<string name="btnDone">Save</string> <string name="btnDone">Save</string>
<string name="which_browser">Which browser would you like to use?</string> <string name="which_browser">Which browser would you like to use?</string>
<string name="authorSite">http://cv.gaulupeau.fr</string> <string name="authorSite">http://cv.gaulupeau.fr</string>
<string name="url_label"><b><u>Your wallabag URL :</u></b></string> <string name="url_label"><b><u>Your wallabag URL :</u></b></string>
<string name="url_help">Examples:\n<i>http://wallabag.example.fr</i>\n<i>http://www.example.fr/wallabag</i></string> <string name="url_help">Examples:\n<i>http://wallabag.example.fr</i>\n<i>http://www.example.fr/wallabag</i></string>
<string name="btnGetPost">List articles</string> <string name="btnGetPost">List articles - %1$d unread</string>
<string name="btnSync">Synchronize</string> <string name="btnSync">Synchronize</string>
<string name="btnMarkRead">Mark as Read</string> <string name="btnMarkRead">Mark as Read</string>
<string name="menuSettings">Settings</string> <string name="btnSettings">Settings</string>
<string name="menuShowAll">Show All</string> <string name="menuShowAll">Show All</string>
<string name="menuWipeDb">Wipe Database</string> <string name="menuWipeDb">Wipe Database</string>
<string name="txtSyncDone">Synchronize done !</string> <string name="txtSyncDone">Synchronize done !</string>