update to 0.5.7 - see readme for changelog

This commit is contained in:
David Development 2014-03-25 20:57:05 +01:00
parent 6bc61819b0
commit b33a9348ad
31 changed files with 767 additions and 735 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<module external.linked.project.path="C:\Users\David\Documents\Android-Projects\News-Android-App" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />

View file

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="News-Android-App" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="C:\Users\David\Documents\Android-Projects\News-Android-App\News-Android-App" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="News-Android-App" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":News-Android-App" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
@ -15,11 +20,6 @@
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":News-Android-App" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/debug" />
@ -30,31 +30,31 @@
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test/debug" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test/debug" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test/debug" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test/debug" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/r/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/aidl/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/buildConfig/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/source/rs/test/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/res/rs/test/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/instrumentTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/apk" />
<excludeFolder url="file://$MODULE_DIR$/build/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/bundles" />
@ -69,15 +69,15 @@
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="MessageBar" exported="" />
<orderEntry type="library" exported="" name="ComGithubChrisbanesActionbarpulltorefreshExtraAbs093.aar" level="project" />
<orderEntry type="library" exported="" name="extra-abs-0.9.3" level="project" />
<orderEntry type="library" exported="" name="library-0.2.0" level="project" />
<orderEntry type="library" exported="" name="library-0.9.3" level="project" />
<orderEntry type="library" exported="" name="gson-2.2.4" level="project" />
<orderEntry type="library" exported="" name="ComActionbarsherlockActionbarsherlock440.aar" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.7.2" level="project" />
<orderEntry type="library" exported="" name="ComGithubCastorflexSmoothprogressbarLibrary020.aar" level="project" />
<orderEntry type="library" exported="" name="support-v4-19.0.1" level="project" />
<orderEntry type="library" exported="" name="actionbarsherlock-4.4.0" level="project" />
<orderEntry type="module" module-name="MessageBar" exported="" />
<orderEntry type="module" module-name="ChangeLogLibrary" exported="" />
<orderEntry type="library" exported="" name="ComGithubChrisbanesActionbarpulltorefreshLibrary093.aar" level="project" />
</component>
</module>

View file

@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
@ -24,6 +24,7 @@ android {
}
}
sourceSets {
main {
aidl.srcDirs = ['src/main/java']

View file

@ -1,46 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.luhmer.owncloudnewsreader"
android:versionCode="41"
android:versionName="0.5.6" >
android:versionCode="42"
android:versionName="0.5.7" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application
android:debuggable="false"
android:allowBackup="true"
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme" >
<activity
android:name="de.luhmer.owncloudnewsreader.NewsReaderListActivity"
android:label="@string/app_name"> <!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
android:label="@string/app_name" >
<!-- android:configChanges="keyboardHidden|orientation|screenSize" -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="de.luhmer.owncloudnewsreader.NewsDetailActivity"
android:label="@string/title_activity_news_detail"
android:configChanges="keyboardHidden|orientation|screenSize" >
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_news_detail" >
</activity>
<service android:name="de.luhmer.owncloudnewsreader.services.DownloadImagesService" />
@ -50,55 +47,55 @@
android:name="de.luhmer.owncloudnewsreader.SettingsActivity"
android:label="@string/title_activity_settings" >
</activity>
<activity android:name=".DownloadImagesActivity" />
<activity android:name="de.luhmer.owncloudnewsreader.DownloadImagesActivity" />
<!--
**********************************************************************
* Sync Adapter and Service
**********************************************************************
-->
<service
android:name="de.luhmer.owncloudnewsreader.services.OwnCloudAuthenticatorService"
android:exported="true" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<service android:name="de.luhmer.owncloudnewsreader.services.OwnCloudSyncService" />
<service
android:name="de.luhmer.owncloudnewsreader.services.OwnCloudSettingsSyncService"
android:exported="true" >
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
android:exported="true" >
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
<provider
android:name=".providers.OwnCloudSyncProvider"
android:authorities="de.luhmer.owncloudnewsreader"
android:label="@string/auto_sync_string"
android:syncable="true">
android:name="de.luhmer.owncloudnewsreader.providers.OwnCloudSyncProvider"
android:authorities="de.luhmer.owncloudnewsreader"
android:label="@string/auto_sync_string"
android:syncable="true" >
</provider>
<!--
<!--
<activity
android:name=".authentication.AuthenticatorActivity"
android:label="@string/title_activity_settings"
android:launchMode="singleTask" > -->
<!-- android:theme="@style/Theme.Transparent" > --><!--
</activity>
-->
android:launchMode="singleTask" >
-->
<!-- android:theme="@style/Theme.Transparent" > -->
<!-- </activity> -->
<!--
**********************************************************************
* Widget Provider Receiver
@ -113,11 +110,16 @@
android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />
</receiver>
<service
android:name="de.luhmer.owncloudnewsreader.widget.WidgetService"
android:exported="false"
android:permission="android.permission.BIND_REMOTEVIEWS" />
<activity
android:name="de.luhmer.owncloudnewsreader.SyncIntervalSelectorActivity"
android:label="@string/title_activity_sync_interval_selector" >
</activity>
</application>
</manifest>

View file

@ -0,0 +1,31 @@
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
(function (link) {
var timer;
link.addEventListener('mouseup', function() {
clearTimeout(timer);
});
link.addEventListener('mousedown', function (e) {
timer = window.setTimeout(function() {
e.preventDefault();
Android.openLinkInBrowser(link.getAttribute('href'));
}, 1000);
});
link.addEventListener("touchstart", function(e){
timer = window.setTimeout(function() {
e.preventDefault();
Android.openLinkInBrowser(link.getAttribute('href'));
}, 1000);
});
link.addEventListener('touchend', function() {
clearTimeout(timer);
});
})(links[i]);
}

View file

@ -54,8 +54,8 @@ import de.luhmer.owncloudnewsreader.reader.IReader;
import de.luhmer.owncloudnewsreader.reader.owncloud.OwnCloud_Reader;
import de.luhmer.owncloudnewsreader.widget.WidgetProvider;
public class NewsDetailActivity extends SherlockFragmentActivity {
public class NewsDetailActivity extends SherlockFragmentActivity {
/**
* The {@link android.support.v4.view.PagerAdapter} that will provide
* fragments for each of the sections. We use a
@ -71,38 +71,38 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
*/
public ViewPager mViewPager;
private int currentPosition;
PostDelayHandler pDelayHandler;
MenuItem menuItem_Starred;
MenuItem menuItem_Read;
IReader _Reader;
//ArrayList<Integer> databaseItemIds;
DatabaseConnection dbConn;
//public List<RssFile> rssFiles;
Cursor cursor;
public static final String DATABASE_IDS_OF_ITEMS = "DATABASE_IDS_OF_ITEMS";
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeChooser.chooseTheme(this);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_news_detail);
pDelayHandler = new PostDelayHandler(this);
_Reader = new OwnCloud_Reader();
dbConn = new DatabaseConnection(this);
Intent intent = getIntent();
//long subsciption_id = -1;
//long folder_id = -1;
int item_id = 0;
//if(intent.hasExtra(NewsReaderDetailActivity.SUBSCRIPTION_ID))
// subsciption_id = intent.getExtras().getLong(NewsReaderDetailActivity.SUBSCRIPTION_ID);
//if(intent.hasExtra(NewsReaderDetailActivity.FOLDER_ID))
@ -112,13 +112,13 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
if(intent.hasExtra(NewsReaderListActivity.TITEL))
getSupportActionBar().setTitle(intent.getExtras().getString(NewsReaderListActivity.TITEL));
//getActionBar().setTitle(intent.getExtras().getString(NewsReaderDetailActivity.TITEL));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//if(intent.hasExtra(DATABASE_IDS_OF_ITEMS))
// databaseItemIds = intent.getIntegerArrayListExtra(DATABASE_IDS_OF_ITEMS);
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
SORT_DIRECTION sDirection = SORT_DIRECTION.asc;
String sortDirection = mPrefs.getString(SettingsActivity.SP_SORT_ORDER, "1");
@ -158,31 +158,31 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
{
ex.printStackTrace();
}
mViewPager.setOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageSelected(int pos) {
PageChanged(pos);
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
});
}
@Override
protected void onDestroy() {
if(dbConn != null)
dbConn.closeDatabase();
super.onDestroy();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
@ -196,7 +196,7 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
return true;
}
}
else if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP))
{
if(currentPosition > 0)
@ -221,7 +221,7 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
}
}
}
return super.onKeyDown(keyCode, event);
}
@ -230,14 +230,14 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
StopVideoOnCurrentPage();
currentPosition = position;
ResumeVideoPlayersOnCurrentPage();
//String idFeed = String.valueOf(rssFiles.get(position).getDB_Id());
String idFeed = getIdCurrentFeed(currentPosition);
if(!dbConn.isFeedUnreadStarred(idFeed, true))
{
markItemAsReadUnread(idFeed, true);
{
markItemAsReadUnread(idFeed, true);
pDelayHandler.DelayTimer();
Log.d("PAGE CHANGED", "PAGE: " + position + " - IDFEED: " + idFeed);
@ -259,15 +259,15 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
}
return "-1";
}
private void ResumeVideoPlayersOnCurrentPage()
{
NewsDetailFragment fragment = (NewsDetailFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + currentPosition);
if(fragment != null) // could be null if not instantiated yet
fragment.ResumCurrentPage();
fragment.ResumeCurrentPage();
}
private void StopVideoOnCurrentPage()
{
NewsDetailFragment fragment = (NewsDetailFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + currentPosition);
@ -324,20 +324,20 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
//Bitmap bitmapResized = Bitmap.createScaledBitmap(b, 32, 32, false);
return new BitmapDrawable(bitmapResized);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
//getMenuInflater().inflate(R.menu.news_detail, menu);
getSupportMenuInflater().inflate(R.menu.news_detail, menu);
menuItem_Starred = menu.findItem(R.id.action_starred);
menuItem_Read = menu.findItem(R.id.action_read);
UpdateActionBarIcons();
return true;
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
String idFeed = getIdCurrentFeed(currentPosition);
@ -354,8 +354,8 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
case android.R.id.home:
super.onBackPressed();
break;
case R.id.action_starred:
case R.id.action_starred:
//String idItem_Db = String.valueOf(rssFiles.get(currentPosition).getDB_Id());
String idItem_Db = getIdCurrentFeed(currentPosition);
//String idItem = String.valueOf(rssFiles.get(currentPosition).getItem_Id());
@ -364,17 +364,17 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
//rssFiles.get(currentPosition).setStarred(!curState);
dbConn.updateIsStarredOfItem(idItem_Db, !curState);
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
List<String> idItems = new ArrayList<String>();
cursor.moveToFirst();
idItems.add(cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_RSSITEM_ID)));
cursor.close();
break;
case R.id.action_openInBrowser:
//String link = rssFiles.get(currentPosition).getLink();
@ -385,8 +385,8 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
startActivity(browserIntent);
}
break;
/*
case R.id.action_sendSourceCode:
String description = "";
@ -396,8 +396,8 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
description = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_BODY));
cursor.close();
}
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"david-dev@live.de"});
@ -408,7 +408,7 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
startActivity(Intent.createChooser(i, getString(R.string.email_sendMail)));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(NewsDetailActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
}
}
break;
*/
case R.id.action_ShareItem:
@ -428,31 +428,31 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
}
//content += "<br/><br/>Send via <a href=\"https://play.google.com/store/apps/details?id=de.luhmer.owncloudnewsreader\">ownCloud News Reader</a>";
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("text/plain");
//share.putExtra(Intent.EXTRA_SUBJECT, rssFiles.get(currentPosition).getTitle());
//share.putExtra(Intent.EXTRA_TEXT, rssFiles.get(currentPosition).getLink());
share.putExtra(Intent.EXTRA_SUBJECT, title);
share.putExtra(Intent.EXTRA_TEXT, content);
startActivity(Intent.createChooser(share, "Share Item"));
break;
case R.id.action_read:
if(cursor != null)
{
cursor.moveToFirst();
String id = cursor.getString(0);
markItemAsReadUnread(id, !menuItem_Read.isChecked());
cursor.close();
}
}
UpdateActionBarIcons();
pDelayHandler.DelayTimer();
break;
}
@ -461,8 +461,8 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
return super.onOptionsItemSelected(item);
}
private void markItemAsReadUnread(String item_id, boolean read) {
dbConn.updateIsReadOfItem(item_id, read);
UpdateActionBarIcons();
@ -471,7 +471,7 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
/*
OnAsyncTaskCompletedListener asyncTaskCompletedPerformTagRead = new OnAsyncTaskCompletedListener() {
@Override
public void onAsyncTaskCompleted(int task_id, Object task_result) {
boolean success = (Boolean) task_result;
@ -481,12 +481,12 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
Log.d("FINISHED PERFORM TAG READ ", "" + task_result);
}
};
OnAsyncTaskCompletedListener asyncTaskCompletedPerformTagStarred = new OnAsyncTaskCompletedListener() {
@Override
public void onAsyncTaskCompleted(int task_id, Object task_result) {
Log.d("FINISHED PERFORM TAG STARRED ", "" + task_result);
Log.d("FINISHED PERFORM TAG STARRED ", "" + task_result);
}
};
*/
@ -505,7 +505,7 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
*/
public class SectionsPagerAdapter extends FragmentPagerAdapter {
//public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
public SectionsPagerAdapter(FragmentManager fm) {
super(fm);
@ -522,8 +522,8 @@ public class NewsDetailActivity extends SherlockFragmentActivity {
fragment.setArguments(args);
return fragment;
}
@Override
public int getCount() {
return cursor.getCount();

View file

@ -49,24 +49,25 @@ import de.luhmer.owncloudnewsreader.database.DatabaseConnection;
import de.luhmer.owncloudnewsreader.helper.FontHelper;
import de.luhmer.owncloudnewsreader.helper.ImageHandler;
import de.luhmer.owncloudnewsreader.helper.ThemeChooser;
import de.luhmer.owncloudnewsreader.interfaces.WebViewLinkLongClickInterface;
public class NewsDetailFragment extends SherlockFragment {
public static final String ARG_SECTION_NUMBER = "ARG_SECTION_NUMBER";
public static final String TAG = "NewsDetailFragment";
public static String web_template;
public static int background_color = Integer.MIN_VALUE;
public WebView webview;
private ProgressBar progressbar_webview;
private int section_number;
public NewsDetailFragment() {
//setRetainInstance(true);
}
/*
@Override
public void onSaveInstanceState(Bundle outState) {
@ -76,7 +77,7 @@ public class NewsDetailFragment extends SherlockFragment {
@Override
public void onResume() {
super.onResume();
ResumCurrentPage();
ResumeCurrentPage();
}
@Override
@ -109,7 +110,7 @@ public class NewsDetailFragment extends SherlockFragment {
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public void ResumCurrentPage()
public void ResumeCurrentPage()
{
/*
Class.forName("android.webkit.WebView")
@ -123,33 +124,29 @@ public class NewsDetailFragment extends SherlockFragment {
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_news_detail, container, false);
section_number = (Integer) getArguments().get(ARG_SECTION_NUMBER);
webview = (WebView) rootView.findViewById(R.id.webview);
if(ThemeChooser.isDarkTheme(getActivity())) {
webview.setBackgroundColor(getResources().getColor(android.R.color.background_dark));
}
progressbar_webview = (ProgressBar) rootView.findViewById(R.id.progressbar_webview);
LoadRssItemInWebView();
return rootView;
}
public void LoadRssItemInWebView()
{
{
NewsDetailActivity ndActivity = ((NewsDetailActivity)getActivity());
if(background_color != Integer.MIN_VALUE && ThemeChooser.isDarkTheme(ndActivity))
{
//webview.setBackgroundColor(background_color);
webview.setBackgroundColor(background_color);
ndActivity.mViewPager.setBackgroundColor(background_color);
}
@ -158,17 +155,17 @@ public class NewsDetailFragment extends SherlockFragment {
String idItem = nrda.getIdCurrentFeed(section_number - 1);
webview.loadDataWithBaseURL("", getHtmlPage(ndActivity, ndActivity.dbConn, Integer.parseInt(idItem)), "text/html", "UTF-8", "");
}
@SuppressLint("SetJavaScriptEnabled")
private void init_webView()
{
WebSettings webSettings = webview.getSettings();
//webSettings.setPluginState(WebSettings.PluginState.ON);
WebSettings webSettings = webview.getSettings();
//webSettings.setPluginState(WebSettings.PluginState.ON);
webSettings.setJavaScriptEnabled(true);
webSettings.setAllowFileAccess(true);
//webSettings.setPluginsEnabled(true);
//webSettings.setDomStorageEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(
false);
webSettings.setSupportMultipleWindows(false);
@ -183,49 +180,84 @@ public class NewsDetailFragment extends SherlockFragment {
//webSettings.setDatabaseEnabled(true);
//webview.clearCache(true);
webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
webview.addJavascriptInterface(new WebViewLinkLongClickInterface(getActivity()), "Android");
webview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress)
{
if(progress < 100 && progressbar_webview.getVisibility() == ProgressBar.GONE){
progressbar_webview.setVisibility(ProgressBar.VISIBLE);
progressbar_webview.setVisibility(ProgressBar.VISIBLE);
}
progressbar_webview.setProgress(progress);
if(progress == 100) {
progressbar_webview.setVisibility(ProgressBar.GONE);
//The following three lines are a workaround for websites which don't use a background colour
NewsDetailActivity ndActivity = ((NewsDetailActivity)getActivity());
webview.setBackgroundColor(getResources().getColor(R.color.slider_listview_text_color));
ndActivity.mViewPager.setBackgroundColor(getResources().getColor(R.color.slider_listview_text_color));
if(ThemeChooser.isDarkTheme(getActivity())) {
webview.setBackgroundColor(getResources().getColor(android.R.color.transparent));
}
String jsLinkLongClick = getTextFromAssets("LinkLongClick.js", getActivity());
//webview.loadUrl("javascript:(function(){document.getElementById('buttonClick').click();})()");
webview.loadUrl("javascript:(function(){ " + jsLinkLongClick + " })()");
/*
image.addEventListener("touchstart", function(e){
timer = window.setTimeout(function() {
e.preventDefault();
alert(image.getAttribute('title'));
//alert("fired - touchstart");
}, 1000);
});
image.addEventListener('touchend', function() {
clearTimeout(timer);
});
*/
}
}
});
webview.setWebViewClient(new WebViewClient() {
});
}
@SuppressLint("SimpleDateFormat")
public static String getHtmlPage(Context context, DatabaseConnection dbConn, int idItem)
{
init_webTemplate(context);
String htmlData = web_template;
//RssFile rssFile = ((NewsDetailActivity)getActivity()).rssFiles.get(section_number - 1);
//int idItem = ndActivity.databaseItemIds.get(section_number - 1);
Cursor cursor = dbConn.getArticleByID(String.valueOf(idItem));
cursor.moveToFirst();
String favIconUrl = "";
try {
Cursor favIconCursor = dbConn.getFeedByDbID(cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_SUBSCRIPTION_ID)));
try
{
{
favIconCursor.moveToFirst();
if(favIconCursor.getCount() > 0)
{
@ -244,8 +276,8 @@ public class NewsDetailFragment extends SherlockFragment {
} finally {
favIconCursor.close();
}
String divHeader = "<div id=\"header\">";
StringBuilder sb = new StringBuilder(htmlData);
//htmlData = sb.insert(htmlData.indexOf(divHeader) + divHeader.length(), rssFile.getTitle().trim()).toString();
@ -253,11 +285,11 @@ public class NewsDetailFragment extends SherlockFragment {
String linkToFeed = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
title = "<a href=\"" + linkToFeed + "\">" + title + "</a>";
htmlData = sb.insert(htmlData.indexOf(divHeader) + divHeader.length(), title.trim()).toString();
//String divSubscription = "<div id=\"subscription\">";
//htmlData = sb.insert(htmlData.indexOf(divSubscription) + divSubscription.length(), rssFile.getStreamID().trim()).toString();
Date date = new Date(cursor.getLong(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_PUBDATE)));
if(date != null)
{
@ -267,42 +299,42 @@ public class NewsDetailFragment extends SherlockFragment {
String dateString = (String) DateUtils.getRelativeTimeSpanString(date.getTime());
htmlData = sb.insert(htmlData.indexOf(divDate) + divDate.length(), dateString).toString();
}
//String subscription = ((NewsDetailActivity) getActivity()).dbConn.getTitleOfSubscriptionByRowID(String.valueOf(rssFile.getFeedID_Db()));
//String subscription = dbConn.getTitleOfSubscriptionByDBItemID(String.valueOf(idItem));
Cursor cursorFeed = dbConn.getFeedByDbID(cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_SUBSCRIPTION_ID)));
cursorFeed.moveToFirst();
String subscription = cursorFeed.getString(cursorFeed.getColumnIndex(DatabaseConnection.SUBSCRIPTION_HEADERTEXT)).trim();
cursorFeed.close();
String authorOfArticle = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_AUTHOR));
if(authorOfArticle != null)
if(!authorOfArticle.trim().equals(""))
subscription += " - " + authorOfArticle.trim();
String divSubscription = "<div id=\"subscription\">";
int pos = htmlData.indexOf(divSubscription) + divSubscription.length();
pos = htmlData.indexOf("/>", pos) + 2;//Wegen des Favicon <img />
pos = htmlData.indexOf("/>", pos) + 2;//Wegen des Favicon <img />
htmlData = sb.insert(pos, subscription.trim()).toString();
String divContent = "<div id=\"content\">";
String description = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_BODY));
//htmlData = sb.insert(htmlData.indexOf(divContent) + divContent.length(), rssFile.getDescription().trim()).toString();
htmlData = sb.insert(htmlData.indexOf(divContent) + divContent.length(), getDescriptionWithCachedImages(description, context).trim()).toString();
//String link = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
//String link = cursor.getString(cursor.getColumnIndex(DatabaseConnection.RSS_ITEM_LINK));
//Uri uri = Uri.parse(rssFile.getLink());
//Uri uri = Uri.parse(link);
//String domainName = uri.getHost();
//String searchString = "http://s2.googleusercontent.com/s2/favicons?domain=";
//htmlData = sb.insert(htmlData.indexOf(searchString) + searchString.length(), domainName).toString();
String searchString = "<img id=\"imgFavicon\" src=";
htmlData = sb.insert(htmlData.indexOf(searchString) + searchString.length() + 1, favIconUrl).toString();
//htmlData = URLEncoder.encode(htmlData).replaceAll("\\+"," ");
//webview.loadDataWithBaseURL("", htmlData, "text/html", "UTF-8", "");
//webview.loadData(htmlData, "text/html; charset=UTF-8", "UTF-8");
} catch (Exception e) {
@ -310,15 +342,15 @@ public class NewsDetailFragment extends SherlockFragment {
} finally {
cursor.close();
}
return htmlData;
}
private static String getDescriptionWithCachedImages(String text, Context context)
{
List<String> links = ImageHandler.getImageLinksFromText(text);
for(String link : links)
{
link = link.trim();
@ -333,10 +365,10 @@ public class NewsDetailFragment extends SherlockFragment {
ex.printStackTrace();
}
}
return text;
}
/*
@Override
protected void onCreateContextMenu(ContextMenu menu) {
@ -367,81 +399,88 @@ public class NewsDetailFragment extends SherlockFragment {
menu.add(0, ID_SHARELINK, 0, "Share Link").setOnMenuItemClickListener(handler);
}
}*/
private static void init_webTemplate(Context context)
static String getTextFromAssets(String fileName, Context context) {
InputStream input;
try {
input = context.getAssets().open(fileName);
int size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
// byte buffer into a string
return new String(buffer);
} catch(Exception ex) {
ex.printStackTrace();
}
return "";
}
private static void init_webTemplate(Context context)
{
if(web_template == null)
{
InputStream input = null;
try {
//Activity act = getActivity();
input = context.getAssets().open("web_template.html");
int size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
// byte buffer into a string
web_template = new String(buffer);
web_template = getTextFromAssets("web_template.html", context);
String background_color_string = SearchString(web_template, "background-color:", ";");
if(background_color_string != null)
{
{
//if(background_color.matches("^#.{3,6}$"))
if(background_color_string.matches("^#.{3}$"))
if(background_color_string.matches("^#.{3}$"))
background_color = Color.parseColor(convertHexColorFrom3To6Characters(background_color_string));
else if(background_color_string.matches("^#.{6}$"))
background_color = Color.parseColor(background_color_string);
}
if(ThemeChooser.isDarkTheme(context))
web_template = web_template.replace("<body id=\"lightTheme\">", "<body id=\"darkTheme\">");
FontHelper fHelper = new FontHelper(context);
web_template = web_template.replace("ROBOTO_FONT_STYLE", fHelper.getFontName());
/*
DisplayMetrics displaymetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
//int height = displaymetrics.heightPixels;
int width = displaymetrics.widthPixels;
*/
*/
} catch(Exception ex){
ex.printStackTrace();
}
}
}
private static String SearchString(String data, String startString, String endString)
{
int start = data.indexOf(startString) + startString.length();
int end = data.indexOf(endString, start);
if(start != (-1 + startString.length()) && end != -1)
data = data.substring(start, end).trim();
return data;
}
private static String convertHexColorFrom3To6Characters(String color)
{
for(int i = 1; i < 6; i += 2)
color = color.substring(0, i) + color.charAt(i) + color.substring(i);
return color;
}
}

View file

@ -33,6 +33,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.widget.SlidingPaneLayout;
@ -74,27 +75,27 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
static final String TAG = "NewsReaderListActivity";
//ActionBarDrawerToggle drawerToggle;
//DrawerLayout drawerLayout;
public static final String FOLDER_ID = "FOLDER_ID";
public static final String SUBSCRIPTION_ID = "SUBSCRIPTION_ID";
public static final String ITEM_ID = "ITEM_ID";
public static final String TITEL = "TITEL";
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
protected void onCreate(Bundle savedInstanceState) {
ThemeChooser.chooseTheme(this);
//setTheme(R.style.Theme_Sherlock);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_newsreader);
AccountManager mAccountManager = AccountManager.get(this);
boolean isAccountThere = false;
//Remove all accounts first
Account[] accounts = mAccountManager.getAccounts();
@ -104,9 +105,9 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
isAccountThere = true;
}
}
if(!isAccountThere) {
//Then add the new account
//Then add the new account
Account account = new Account(getString(R.string.app_name), AccountGeneral.ACCOUNT_TYPE);
mAccountManager.addAccountExplicitly(account, "", new Bundle());
//ContentResolver.setSyncAutomatically(account, getString(R.string.authorities), true);
@ -117,26 +118,26 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if(mPrefs.getString(SettingsActivity.EDT_OWNCLOUDROOTPATH_STRING, null) == null)
StartLoginFragment(NewsReaderListActivity.this);
// Insert the fragment by replacing any existing fragment
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.left_drawer, new NewsReaderListFragment())
.commit();
mSlidingLayout = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
mSlidingLayout.setParallaxDistance(280);
mSlidingLayout.setParallaxDistance(280);
mSlidingLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
mSlidingLayout.setPanelSlideListener(new PanelSlideListener() {
@Override
public void onPanelSlide(View arg0, float arg1) {
}
@Override
public void onPanelOpened(View arg0) {
updateAdapter();
@ -146,7 +147,7 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
getMenuItemUpdater().setVisible(false);
}
@Override
public void onPanelClosed(View arg0) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
@ -158,25 +159,25 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
}
});
mSlidingLayout.openPane();
/*
// Get a reference of the DrawerLayout
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
*/
// Set a listener to be notified of drawer events.
//drawerLayout.setDrawerListener(drawerToggle);
//if(mPrefs.getBoolean(SettingsActivity.CB_SYNCONSTARTUP_STRING, false))
// startSync();
/*
if(!shouldDrawerStayOpen()) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}*/
if(savedInstanceState == null)//When the app starts (no orientation change)
{
startDetailFHolder = new StartDetailFragmentHolder(SubscriptionExpandableListAdapter.ALL_UNREAD_ITEMS, true, null, true);
@ -194,25 +195,25 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
private static final String ID_FEED_STRING = "ID_FEED_STRING";
private static final String IS_FOLDER_BOOLEAN = "IS_FOLDER_BOOLEAN";
private static final String OPTIONAL_FOLDER_ID ="OPTIONAL_FOLDER_ID";
/* (non-Javadoc)
* @see com.actionbarsherlock.app.SherlockFragmentActivity#onSaveInstanceState(android.os.Bundle)
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
NewsReaderDetailFragment ndf = ((NewsReaderDetailFragment) getSupportFragmentManager().findFragmentById(R.id.content_frame));
if(ndf != null) {
View v = ndf.getListView().getChildAt(0);
int top = (v == null) ? 0 : v.getTop();
outState.putInt(FIRST_VISIBLE_DETAIL_ITEM_STRING, ndf.getListView().getFirstVisiblePosition());
outState.putInt(FIRST_VISIBLE_DETAIL_ITEM_MARGIN_TOP_STRING, top);
outState.putString(OPTIONAL_FOLDER_ID, ndf.getIdFeed() == null ? ndf.getIdFolder() : ndf.getIdFeed());
outState.putBoolean(IS_FOLDER_BOOLEAN, ndf.getIdFeed() == null ? true : false);
outState.putString(ID_FEED_STRING, ndf.getIdFeed() != null ? ndf.getIdFolder() : ndf.getIdFeed());
}
super.onSaveInstanceState(outState);
}
@ -220,19 +221,19 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
* @see com.actionbarsherlock.app.SherlockFragmentActivity#onRestoreInstanceState(android.os.Bundle)
*/
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
protected void onRestoreInstanceState(Bundle savedInstanceState) {
if(savedInstanceState != null) {
if(savedInstanceState.containsKey(FIRST_VISIBLE_DETAIL_ITEM_STRING) &&
savedInstanceState.containsKey(ID_FEED_STRING) &&
savedInstanceState.containsKey(IS_FOLDER_BOOLEAN) &&
savedInstanceState.containsKey(OPTIONAL_FOLDER_ID)) {
startDetailFHolder = new StartDetailFragmentHolder(savedInstanceState.getString(OPTIONAL_FOLDER_ID),
savedInstanceState.getBoolean(IS_FOLDER_BOOLEAN),
savedInstanceState.getString(ID_FEED_STRING),
false);
NewsReaderDetailFragment ndf = StartDetailFragmentNow();
if(ndf != null) {
ndf.setActivatedPosition(savedInstanceState.getInt(FIRST_VISIBLE_DETAIL_ITEM_STRING));
@ -263,30 +264,30 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
{
// Block children layout for now
BlockingExpandableListView bView = ((BlockingExpandableListView) nlf.eListView);
int firstVisPos = bView.getFirstVisiblePosition();
View firstVisView = bView.getChildAt(0);
int top = firstVisView != null ? firstVisView.getTop() : 0;
// Number of items added before the first visible item
// Number of items added before the first visible item
int itemsAddedBeforeFirstVisible = 0;
bView.setBlockLayoutChildren(true);
nlf.lvAdapter.notifyDataSetChanged();
bView.setBlockLayoutChildren(false);
// Call setSelectionFromTop to change the ListView position
if(bView.getCount() >= firstVisPos + itemsAddedBeforeFirstVisible)
bView.setSelectionFromTop(firstVisPos + itemsAddedBeforeFirstVisible, top);
}
}
@Override
protected void onResume() {
ThemeChooser.chooseTheme(this);
updateAdapter();
super.onResume();
}
@ -297,20 +298,20 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
}
private StartDetailFragmentHolder startDetailFHolder = null;
private class StartDetailFragmentHolder {
String idSubscription;
boolean isFolder;
String optional_folder_id;
boolean updateListView;
public StartDetailFragmentHolder(String idSubscription, boolean isFolder, String optional_folder_id, boolean updateListView) {
this.idSubscription = idSubscription;
this.isFolder = isFolder;
this.optional_folder_id = optional_folder_id;
this.updateListView = updateListView;
}
public NewsReaderDetailFragment StartDetailFragment() {
return NewsReaderListActivity.this.StartDetailFragment(idSubscription, isFolder, optional_folder_id, updateListView);
}
@ -324,9 +325,9 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
public void onTopItemClicked(String idSubscription, boolean isFolder, String optional_folder_id) {
if(!shouldDrawerStayOpen())
mSlidingLayout.closePane();
startDetailFHolder = new StartDetailFragmentHolder(idSubscription, isFolder, optional_folder_id, true);
if(shouldDrawerStayOpen())
StartDetailFragmentNow();
}
@ -335,23 +336,23 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
public void onChildItemClicked(String idSubscription, String optional_folder_id) {
if(!shouldDrawerStayOpen())
mSlidingLayout.closePane();
//StartDetailFragment(idSubscription, false, optional_folder_id);
startDetailFHolder = new StartDetailFragmentHolder(idSubscription, false, optional_folder_id, true);
if(shouldDrawerStayOpen())
StartDetailFragmentNow();
}
private NewsReaderDetailFragment StartDetailFragment(String id, Boolean folder, String optional_folder_id, boolean UpdateListView)
{
{
if(super.getMenuItemDownloadMoreItems() != null)
super.getMenuItemDownloadMoreItems().setEnabled(true);
DatabaseConnection dbConn = new DatabaseConnection(getApplicationContext());
Intent intent = new Intent();
if(!folder)
{
intent.putExtra(SUBSCRIPTION_ID, id);
@ -369,9 +370,9 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
else if(idFolder == -11)
intent.putExtra(TITEL, getString(R.string.starredFeeds));
}
Bundle arguments = intent.getExtras();
NewsReaderDetailFragment fragment = new NewsReaderDetailFragment();
fragment.setUpdateListViewOnStartUp(UpdateListView);
@ -381,7 +382,7 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
.commit();
dbConn.closeDatabase();
return fragment;
}
@ -398,7 +399,7 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
void startSync()
{
//menuItemUpdater.setActionView(R.layout.inderterminate_progress);
((NewsReaderListFragment) getSupportFragmentManager().findFragmentById(R.id.left_drawer)).StartSync();
((NewsReaderListFragment) getSupportFragmentManager().findFragmentById(R.id.left_drawer)).StartSync();
}
public void UpdateButtonSyncLayout()
@ -412,9 +413,9 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
NewsReaderListFragment ndf = (NewsReaderListFragment) getSupportFragmentManager().findFragmentById(R.id.left_drawer);
IOwnCloudSyncService _Reader = ndf._ownCloudSyncService;
PullToRefreshLayout pullToRefreshView = ndf.mPullToRefreshLayout;
if(_Reader != null) {
if(_Reader.isSyncRunning())
if(_Reader.isSyncRunning())
{
super.getMenuItemUpdater().setActionView(R.layout.inderterminate_progress);
if(pullToRefreshView != null && !pullToRefreshView.isRefreshing()) {
@ -433,22 +434,22 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
}
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
//getMenuInflater().inflate(R.menu.news_reader, menu);
//getSupportMenuInflater().inflate(R.menu.news_reader, menu);
super.onCreateOptionsMenu(menu, getSupportMenuInflater(), this);
UpdateButtonSyncLayout();
return true;
}
@Override
public void onBackPressed() {
if(mSlidingLayout.isOpen())
@ -462,31 +463,38 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
@Override
public boolean onOptionsItemSelected(MenuItem item) {
boolean handled = super.onOptionsItemSelected(item, this);
if(!handled)
{
{
switch (item.getItemId()) {
case android.R.id.home:
if(!mSlidingLayout.isOpen())
mSlidingLayout.openPane();
return true;
case R.id.action_settings:
Intent intent = new Intent(this, SettingsActivity.class);
Intent intent = new Intent(this, SettingsActivity.class);
//intent.putExtra(EXTRA_MESSAGE, message);
startActivityForResult(intent, RESULT_SETTINGS);
return true;
case R.id.action_sync_settings:
String[] authorities = { "de.luhmer.owncloudnewsreader" };
Intent intentSyncSettings = new Intent(Settings.ACTION_SYNC_SETTINGS);
intentSyncSettings.putExtra(Settings.EXTRA_AUTHORITIES, authorities);
startActivity(intentSyncSettings);
break;
case R.id.menu_update:
//menuItemUpdater = item.setActionView(R.layout.inderterminate_progress);
startSync();
break;
case R.id.action_login:
StartLoginFragment(NewsReaderListActivity.this);
break;
break;
case R.id.menu_StartImageCaching:
DatabaseConnection dbConn = new DatabaseConnection(this);
try {
@ -522,33 +530,33 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
public static void StartLoginFragment(final SherlockFragmentActivity activity)
{
{
LoginDialogFragment dialog = new LoginDialogFragment();
dialog.setmActivity(activity);
dialog.setmActivity(activity);
dialog.setListener(new LoginSuccessfullListener() {
@Override
public void LoginSucceeded() {
((NewsReaderListActivity) activity).startSync();
}
});
dialog.show(activity.getSupportFragmentManager(), "NoticeDialogFragment");
dialog.show(activity.getSupportFragmentManager(), "NoticeDialogFragment");
}
/*
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//if (requestCode == 1) {
if(resultCode == RESULT_OK){
int pos = data.getIntExtra("POS", 0);
if(resultCode == RESULT_OK){
int pos = data.getIntExtra("POS", 0);
UpdateListViewAndScrollToPos(this, pos);
}
if (resultCode == RESULT_CANCELED) {
//Write your code on no result return
if (resultCode == RESULT_CANCELED) {
//Write your code on no result return
}
//}
}*/
//@TargetApi(Build.VERSION_CODES.FROYO)
public static void UpdateListViewAndScrollToPos(FragmentActivity act, int pos)
@ -557,7 +565,7 @@ public class NewsReaderListActivity extends MenuUtilsSherlockFragmentActivity im
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO)
//((NewsReaderDetailFragment) act.getSupportFragmentManager().findFragmentById(R.id.newsreader_detail_container)).getListView().smoothScrollToPosition(pos);
//else
//Is not used any longer
//((NewsReaderDetailFragment) act.getSupportFragmentManager().findFragmentById(R.id.content_frame)).getListView().setSelection(pos);
}

View file

@ -0,0 +1,152 @@
package de.luhmer.owncloudnewsreader;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.actionbarsherlock.app.SherlockFragment;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import de.luhmer.owncloudnewsreader.authentication.AccountGeneral;
public class SyncIntervalSelectorActivity extends SherlockFragmentActivity {
SharedPreferences mPrefs;
PlaceholderFragment mFragment;
String[] items_values;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sync_interval_selector);
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
items_values = getResources().getStringArray(R.array.array_sync_interval_values);
if (savedInstanceState == null) {
mFragment = new PlaceholderFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.container, mFragment)
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getSupportMenuInflater()
.inflate(R.menu.sync_interval_selector, menu);
return true;
}
@TargetApi(Build.VERSION_CODES.FROYO)
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
} else if(id == R.id.action_save) {
int checkedPosition = mFragment.lvItems.getCheckedItemPosition();
Integer minutes = Integer.parseInt(items_values[checkedPosition]);
mPrefs.edit().putInt(SYNC_INTERVAL_IN_MINUTES_STRING, minutes).commit();
long SYNC_INTERVAL = minutes * SECONDS_PER_MINUTE;
AccountManager mAccountManager = AccountManager.get(this);
Account[] accounts = mAccountManager.getAccountsByType(AccountGeneral.ACCOUNT_TYPE);
for(Account account : accounts) {
ContentResolver.setSyncAutomatically(account, AccountGeneral.ACCOUNT_TYPE, true);
Bundle bundle = new Bundle();
ContentResolver.addPeriodicSync(
account,
AccountGeneral.ACCOUNT_TYPE,
bundle,
SYNC_INTERVAL);
}
finish();
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
// Sync interval constants
public static final long MILLISECONDS_PER_SECOND = 1000L;
public static final long SECONDS_PER_MINUTE = 60L;
//public static final long SYNC_INTERVAL_IN_MINUTES = 60L;
public static final String SYNC_INTERVAL_IN_MINUTES_STRING = "SYNC_INTERVAL_IN_MINUTES_STRING";
public static class PlaceholderFragment extends SherlockFragment {
public ListView lvItems;
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_sync_interval_selector, container, false);
String[] items = getResources().getStringArray(R.array.array_sync_interval);
lvItems = (ListView) rootView.findViewById(R.id.lv_sync_interval_items);
lvItems.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_single_choice, android.R.id.text1, items);
lvItems.setAdapter(adapter);
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
if(!mPrefs.contains(SYNC_INTERVAL_IN_MINUTES_STRING))
lvItems.setItemChecked(items.length - 1, true);//The last item is 24hours. This is the default value!
else {
int position = 0;
int minutes = mPrefs.getInt(SYNC_INTERVAL_IN_MINUTES_STRING, 0);
for(String item : ((SyncIntervalSelectorActivity)getActivity()).items_values) {
if(Integer.parseInt(item) == minutes)
break;
position++;
}
lvItems.setItemChecked(position, true);//The last item is 24hours. This is the default value!
}
return rootView;
}
}
}

View file

@ -0,0 +1,28 @@
package de.luhmer.owncloudnewsreader.interfaces;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.webkit.JavascriptInterface;
/**
* Created by David on 25.03.2014.
*/
public class WebViewLinkLongClickInterface {
Context mContext;
/** Instantiate the interface and set the context */
public WebViewLinkLongClickInterface(Context c) {
mContext = c;
}
/** Show a toast from the web page */
@JavascriptInterface
public void openLinkInBrowser(String url) {
if (!url.startsWith("http://") && !url.startsWith("https://"))
url = "http://" + url;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
mContext.startActivity(browserIntent);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="de.luhmer.tasksync.SyncIntervalSelectorActivity"
tools:ignore="MergeRootFrame" />

View file

@ -0,0 +1,17 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="de.luhmer.tasksync.SyncIntervalSelectorActivity$PlaceholderFragment">
<ListView
android:id="@+id/lv_sync_interval_items"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View file

@ -2,20 +2,20 @@
<item android:id="@+id/menu_update"
android:title="@string/menu_update"
android:icon="@drawable/ic_menu_refresh"
android:icon="@drawable/ic_menu_refresh"
android:showAsAction="always" />
<item android:id="@+id/menu_StartImageCaching"
android:title="@string/menu_StartImageCaching"
android:orderInCategory="95"
android:showAsAction="never" />
<item
android:id="@+id/menu_markAllAsRead"
android:showAsAction="never"
android:orderInCategory="96"
android:title="@string/menu_markAllAsRead"/>
<item
android:id="@+id/menu_downloadMoreItems"
android:showAsAction="never"
@ -27,17 +27,23 @@
android:orderInCategory="98"
android:showAsAction="never"
android:title="@string/action_settings"/>
<item
android:id="@+id/action_sync_settings"
android:orderInCategory="98"
android:showAsAction="never"
android:title="@string/action_sync_settings"/>
<item
android:id="@+id/action_login"
android:orderInCategory="99"
android:showAsAction="never"
android:title="@string/action_login"/>
<item
android:id="@+id/menu_About_Changelog"
android:showAsAction="never"
android:orderInCategory="100"
android:title="@string/menu_About_Changelog"/>
</menu>

View file

@ -0,0 +1,17 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="de.luhmer.owncloudnewsreader.SyncIntervalSelectorActivity" >
<!--
<item android:id="@+id/action_settings"
android:title="@string/action_settings"
android:orderInCategory="100"
app:showAsAction="never" />
-->
<item android:id="@+id/action_save"
android:title="@string/action_save"
android:icon="@drawable/ic_menu_save"
android:showAsAction="always" />
</menu>

View file

@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -1,48 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<string name="pref_title_password">Secret Code</string>
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -1,47 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!--<string name="non_sorted_articles">Nicht zugeordnete Artikel</string>-->
<!--EMAIL-->
<!--Action Bar Items-->
<!--Strings related to login-->
<!--<string name="pref_title_owncloudRootPath">ownCloud root address</string>-->
<!--<string name="pref_default_username">admin</string>-->
<!--Toast Messages-->
<!--Strings related to Settings-->
<!--General settings-->
<!--<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>-->
<!--<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>-->
<!--<string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string>-->
<!--MemorizingTrustManager-->
<!--Settings for Display-->
<!--Login Dialog-->
<!--Data & Sync-->
<!--<string name="pref_title_data_sync_max_items">Max number of items to sync</string>-->
<!--<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
<item>15 minutes</item>
<item>30 minutes</item>
<item>1 hour</item>
<item>3 hours</item>
<item>6 hours</item>
<item>Never</item>
</string-array>
<string-array name="pref_sync_frequency_values">
<item>15</item>
<item>30</item>
<item>60</item>
<item>180</item>
<item>360</item>
<item>-1</item>
</string-array>-->
<!--<string name="pref_title_system_sync_settings">System sync settings</string>-->
<!--<string name="pref_title_new_message_notifications">New message notifications</string>
<string name="pref_title_ringtone">Ringtone</string>
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>-->
</resources>

View file

@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View file

@ -1,49 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="auto_sync_string">Auto sync</string>
<string name="app_name">ownCloud News Reader</string>
<string name="action_settings">Settings</string>
<string name="title_activity_sync_interval_selector">Sync Interval Selector</string>
<string name="title_activity_news_detail">NewsDetailActivity</string>
<string name="title_activity_subscription">SubscriptionActivity</string>
<string name="title_newsreader_list">NewsReader</string>
<string name="title_newsreader_detail">NewsReader Detail</string>
<string name="empty_view_header">Information</string>
<string name="empty_view_content">No items here</string>
<string name="toast_GettingMoreItems">Started downloading more items.. Please wait.</string>
<string name="tv_clickHereToOpenItem">Click here to open item</string>
<string name="no_wifi_available">No WiFi connected</string>
<string name="do_you_want_to_download_without_wifi">Do you want to download the images without a WiFi connection</string>
<string name="max_items_count_reached">You\'ve reached the maxiumum size of XX items</string>
<string name="widget_header">ownCloud News</string>
<string name="message_bar_new_articles_available">New items available</string>
<string name="message_bar_reload">Reload</string>
<string name="allUnreadFeeds">All unread items</string>
<string name="starredFeeds">Starred items</string>
<!-- <string name="non_sorted_articles">Nicht zugeordnete Artikel</string> -->
<string name="menu_update">Refresh</string>
<string name="menu_About_Changelog">About / Changelog</string>
<string name="menu_markAllAsRead">Mark all as read</string>
<string name="menu_StartImageCaching">Download images</string>
<string name="menu_downloadMoreItems">Download more items</string>
<!-- EMAIL -->
<string name="email_sourceCode">Sourcecode of item - Bugreport</string>
<string name="email_sendMail">Send EMail</string>
<!-- Action Bar Items -->
<string name="action_starred">Starred</string>
<string name="action_read">Read</string>
@ -51,40 +39,32 @@
<string name="action_sendSourceCode">Send item to Developer</string>
<string name="action_Share">Share</string>
<string name="action_login">Server Settings</string>
<string name="action_save">Save</string>
<string name="action_settings">Settings</string>
<string name="action_sync_settings">Sync Settings</string>
<string name="notification_new_items_ticker">You have X new unread items</string>
<string name="notification_new_items_text">X new unread items available</string>
<!-- Strings related to login -->
<string name="pref_title_username">Username</string>
<string name="pref_title_password">Password</string>
<!-- <string name="pref_title_owncloudRootPath">ownCloud root address</string> -->
<string name="pref_default_owncloudRootPath">https://1.2.3.4/owncloud</string>
<!-- <string name="pref_default_username">admin</string> -->
<string name="action_sign_in_short">Sign in</string>
<string name="login_progress_signing_in">Signing in&#8230;</string>
<string name="login_progress_signing_in">Signing in</string>
<string name="error_incorrect_password">This password is incorrect</string>
<string name="error_field_required">This field is required</string>
<string name="error_invalid_url">This url is incorrect</string>
<!-- Toast Messages -->
<string name="toast_downloaded_x_items">Downloaded X old items</string>
<string name="toast_no_more_downloads_available">No further items available</string>
<string name="pull_to_refresh_updateTags">Synchronizing items states</string>
<string name="pull_to_refresh_updateFolder">Synchronizing folder</string>
<string name="pull_to_refresh_updateFeeds">Synchronizing feeds</string>
<string name="pull_to_refresh_updateItems">Synchronizing items</string>
<!-- Strings related to Settings -->
<string name="title_activity_settings">Settings</string>
@ -92,23 +72,24 @@
<!-- General settings -->
<string name="pref_header_general">General</string>
<string name="pref_title_general_sort_order">Sort Order</string>
<string-array name="pref_general_sort_order">
<item>New -> Old</item>
<item>Old -> New</item>
<item>New -> Old</item>
<item>Old -> New</item>
</string-array>
<string-array name="pref_general_sort_order_values_not_translated">
<item>1</item>
<item>0</item>
</string-array>
<!--
</string-array>
<!--
<string-array name="pref_general_sort_order_values">
<item>desc</item>
<item>asc</item>
</string-array>
-->
<!--
<!--
<string name="pref_title_social_recommendations">Enable social recommendations</string>
<string name="pref_description_social_recommendations">Recommendations for people to contact based on your message history</string>
-->
@ -118,55 +99,46 @@
<string name="calculating_cache_size">Calculating cache size.. Please wait.</string>
<string name="reset_cache_unsaved_changes">There are unsynchronized changes. Would you like to reset the cache anyway?</string>
<string name="warning">Warning</string>
<string name="pref_title_AutoSyncOnStart">Sync on startup</string>
<string name="pref_title_ShowOnlyUnread">Show only unread articles</string>
<!-- <string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string> -->
<!-- <string name="pref_title_AllowAllSSLCertificates">Allow all SSL Certificates</string> -->
<string name="pref_title_DisableHostnameVerification">Disable Hostname Verification</string>
<string name="pref_title_NavigateWithVolumeButtons">Navigate with volume buttons</string>
<string name="pref_title_MarkAsReadWhileScrolling">Mark as read while scrolling</string>
<string name="pref_title_OpenInBrowserDirectly">Skip detail view and open article in the browser</string>
<string name="pref_title_notification_new_articles_available">Show notification when new articles are available</string>
<!-- MemorizingTrustManager -->
<string name="mtm_accept_cert">Accept Unknown Certificate?</string>
<string name="mtm_decision_always">Always</string>
<string name="mtm_decision_once">Once</string>
<string name="mtm_decision_abort">Abort</string>
<string name="mtm_notification">Certificate Verification</string>
<!-- Settings for Display -->
<string name="pref_header_display">Display</string>
<string name="pref_title_app_theme">App theme (requires restart to apply)</string>
<string name="pref_title_feed_list_layout">Feed list layout</string>
<string name="pref_display_font_layout">Font (requires restart to apply)</string>
<string-array name="pref_display_apptheme">
<item>Dark</item>
<item>Light</item>
<item>Light</item>
</string-array>
<string-array name="pref_display_apptheme_values">
<item>0</item>
<item>1</item>
<item>1</item>
</string-array>
<string-array name="pref_display_feed_list_layout">
<item>Simple</item>
<item>Extended</item>
<item>Extended with Webview</item>
<item>Extended with Webview</item>
</string-array>
<string-array name="pref_display_feed_list_layout_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>2</item>
</string-array>
<string-array name="pref_display_font">
<item>Roboto Thin</item>
<item>Roboto Light</item>
@ -180,8 +152,8 @@
<item>Roboto Slab Light</item>
<item>Roboto Slab Regular</item>
<item>Roboto Slab Bold</item>
</string-array>
<string-array name="pref_display_font_values">
</string-array>
<string-array name="pref_display_font_values">
<item>0</item>
<item>2</item>
<item>4</item>
@ -194,32 +166,26 @@
<item>17</item>
<item>18</item>
<item>19</item>
</string-array>
</string-array>
<!-- Login Dialog -->
<string name="login_dialog_title_error">Error</string>
<string name="login_dialog_text_something_went_wrong">Something went wrong :(</string>
<string name="login_dialog_text_not_compatible">This App version is not compatible with your ownCloud News App. Please update the news app and the appframework.</string>
<string name="login_dialog_text_not_compatible">This App version is not compatible with your ownCloud News App. Please update the news app and the appframework.</string>
<string name="login_dialog_title_security_warning">Security Warning</string>
<string name="login_dialog_text_security_warning">You\'re not using https. An attacker could intercept your traffic and gain access to some sensitive data (e.g. your password). So it\'s strongly recommend to use https!</string>
<!-- Data & Sync -->
<string name="pref_header_data_sync">Data &amp; sync</string>
<!-- <string name="pref_title_data_sync_max_items">Max number of items to sync</string> -->
<!-- <string name="pref_title_data_sync_max_items">Max number of items to sync</string> -->
<string name="pref_title_clearCache">Clear cache</string>
<string name="pref_title_CacheImagesOffline">Cache images offline</string>
<string name="pref_title_Max_Cache_Size">Max Cache Size</string>
<string-array name="pref_data_sync_max_cache_size">
<item>250 MB</item>
<item>500 MB</item>
<item>750 MB</item>
<item>500 MB</item>
<item>750 MB</item>
<item>1 GB</item>
<item>2 GB</item>
<item>5 GB</item>
@ -234,11 +200,34 @@
<item>5000</item>
<item>10000</item>
</string-array>
<!--
<string-array name="array_sync_interval">
<item>5 Minutes</item>
<item>15 Minutes</item>
<item>30 Minutes</item>
<item>45 Minutes</item>
<item>1 Hour</item>
<item>2 Hours</item>
<item>3 Hours</item>
<item>6 Hours</item>
<item>12 Hours</item>
<item>24 Hours</item>
</string-array>
<string-array name="array_sync_interval_values">
<item>5</item>
<item>15</item>
<item>30</item>
<item>45</item>
<item>60</item>
<item>120</item>
<item>180</item>
<item>360</item>
<item>720</item>
<item>1440</item>
</string-array>
<!--
<string name="pref_title_sync_frequency">Sync frequency</string>
<string-array name="pref_sync_frequency_titles">
@ -259,11 +248,8 @@
</string-array>
-->
<!--
<string name="pref_title_system_sync_settings">System sync settings</string>
-->
<!-- <string name="pref_title_system_sync_settings">System sync settings</string> -->
<string name="pref_header_notifications">Notifications</string>
<!--
@ -272,5 +258,5 @@
<string name="pref_ringtone_silent">Silent</string>
<string name="pref_title_vibrate">Vibrate</string>
-->
</resources>

View file

@ -0,0 +1,16 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="Sync Settings" />
<PreferenceScreen
android:key="account_sync_interval"
android:title="Sync Interval"
android:summary="Set the sync interval">
<intent
android:action="de.luhmer.owncloudnewsreader.Preferences.SYNC_INTERVAL"
android:targetPackage="de.luhmer.owncloudnewsreader"
android:targetClass="de.luhmer.owncloudnewsreader.SyncIntervalSelectorActivity" />
</PreferenceScreen>
</PreferenceScreen>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="de.luhmer.owncloudnewsreader"
android:icon="@drawable/ic_launcher"
android:smallIcon="@drawable/ic_launcher"
android:label="@string/app_name"/>
android:accountType="de.luhmer.owncloudnewsreader"
android:icon="@drawable/ic_launcher"
android:smallIcon="@drawable/ic_launcher"
android:label="@string/app_name"
android:accountPreferences="@xml/account_preferences" />

View file

@ -1,7 +1,7 @@
ownCloud News Reader - Android App
==================================
The ownCloud News Reader Android App is under AGPLv3 License terms.
Status: Beta
The ownCloud News Reader Android App is under AGPLv3 License terms.
Status: Beta
Bugs and enhancements can be reported under: https://github.com/owncloud/News-Android-App/issues
<p>
@ -27,27 +27,21 @@ https://groups.google.com/d/forum/owncloud-news-android-app
there you can find a link (after I accepted you in the group) to Google Play for registering as beta tester of the app.
Language
==================================
Is your language not supported yet ?
You can add your language easily on:
https://www.transifex.com/projects/p/owncloud/resource/android-news/
FAQ:
==================================
The app shows an empty Toast when trying to sync or sign-in (little dark box at the button of the screen)
The app shows an empty Toast when trying to sync or sign-in (little dark box at the button of the screen)
- Make sure you're using the latest version of the news app and the appframework from GitHub. Otherwise you can use the Android version <= 0.3.3 (via Google Play or GitHub <a href="https://github.com/owncloud/News-Android-App/commits/master/News-Android-App.apk">Choose version</a>).
How to compile the App
==================================
Requirements:
Requirements:
-----------------------
>1) Android Studio
>2) Git installed (you can do the following stuff without git but I'm not going to show how).
>2) Git installed (you can do the following stuff without git but I'm not going to show how).
Download and install:
Download and install:
-----------------------
>1) Open cmd/terminal
>2) Navigate to your workspace
@ -72,6 +66,9 @@ Updates
==================================
0.5.7 (in development)
---------------------
- Bug fix - <a href="https://github.com/owncloud/News-Android-App/issues/213">#213 When using the dark theme websites with no background color are unreadable</a>
- Improvement - <a href="https://github.com/owncloud/News-Android-App/issues/211">#211 Links within articles</a>
- Improvement - <a href="https://github.com/owncloud/News-Android-App/issues/198">#198 enable auto sync configuration</a>
0.5.6 (Google Play - Beta)
@ -156,7 +153,7 @@ Updates
---------------------
- Fixed app freeze when sync is finished
- Small improvements
0.4.5 (unpublished)
---------------------
@ -252,11 +249,11 @@ Updates
0.3.5
---------------------
- Fixed issue <a href="https://github.com/owncloud/News-Android-App/issues/52">#52 (Folders visible multiple times)</a>
- Fixed issue <a href="https://github.com/owncloud/News-Android-App/issues/53">#53 (New items get added at the bottom)</a>
- Fixed issue <a href="https://github.com/owncloud/News-Android-App/issues/52">#52 (Folders visible multiple times)</a>
- Fixed issue <a href="https://github.com/owncloud/News-Android-App/issues/53">#53 (New items get added at the bottom)</a>
- Added default feed favIcon
- Theme is now also applied in the settings screen
- Implemented <a href="https://github.com/owncloud/News-Android-App/issues/56">#56 (Click on header to open article in browser)</a>
- Implemented <a href="https://github.com/owncloud/News-Android-App/issues/56">#56 (Click on header to open article in browser)</a>
0.3.4
---------------------
@ -271,23 +268,23 @@ Updates
0.3.3
---------------------
- Dark/Light App Theme
- Feed List Design Simple/Extended
- many new languages have been added
- Dark/Light App Theme
- Feed List Design Simple/Extended
- many new languages have been added
0.3.2
---------------------
- Fixed app crash when leaving item detail view.
- Fixed app crash when leaving item detail view.
0.3.1
---------------------
- Polish language support added (thank you for translating Cyryl)
- App crash fixed when no item header text is available
- Go back in the item view if you press the home button
- Added Up Button in detail view as fix for GitHub Issue #13
- Other small fixes
- Polish language support added (thank you for translating Cyryl)
- App crash fixed when no item header text is available
- Go back in the item view if you press the home button
- Added Up Button in detail view as fix for GitHub Issue #13
- Other small fixes
0.3.0
---------------------
- Android 2.2+ Support added
- small bugfixes
- Android 2.2+ Support added
- small bugfixes

View file

@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
classpath 'com.android.tools.build:gradle:0.9.+'
}
}

View file

@ -1,10 +1,11 @@
## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file should *NOT* be checked into Version Control Systems,
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/opt/android-studio/sdk
#Wed Feb 26 20:33:26 CET 2014
sdk.dir=C\:\\Program Files\\Android\\android-studio\\sdk

View file

@ -1,6 +1,6 @@
git rm -r res/values-ach/
git rm -r res/values-ady/
git rm -r res/values-en@pirate/
git rm -r res/values-nds/
git rm -r res/values-nqo/
git rm -r res/values-tzm/
git rm -r News-Android-App/src/main/res/values-ach/
git rm -r News-Android-App/src/main/res/values-ady/
git rm -r News-Android-App/src/main/res/values-en@pirate/
git rm -r News-Android-App/src/main/res/values-nds/
git rm -r News-Android-App/src/main/res/values-nqo/
git rm -r News-Android-App/src/main/res/values-tzm/