Merge branch 'master' into webviewSaveImage
# Conflicts: # News-Android-App/build.gradle # News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsDetailFragment.java
This commit is contained in:
commit
02e0da787c
16 changed files with 516 additions and 64 deletions
|
@ -1 +0,0 @@
|
|||
Subproject commit 8ca20dc53f8754256a277119c17f9a04556752b0
|
|
@ -51,7 +51,6 @@ dependencies {
|
|||
// You must install or update the Google Repository through the SDK manager to use this dependency.
|
||||
// The Google Repository (separate from the corresponding library) can be found in the Extras category.
|
||||
// compile 'com.google.android.gms:play-services:4.2.42'
|
||||
compile project(':Changeloglib:ChangeLogLibrary')
|
||||
compile project(':ownCloud-Account-Importer')
|
||||
compile 'com.android.support:support-v4:23.0.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.1'
|
||||
|
@ -70,6 +69,7 @@ dependencies {
|
|||
compile 'de.greenrobot:greendao-generator:2.0.0'
|
||||
//compile 'org.freemarker:freemarker:2.3.23' //Required for DAO generation
|
||||
compile 'org.apache.commons:commons-lang3:3.4'
|
||||
compile 'com.github.gabrielemariotti.changeloglib:changelog:2.0.0'
|
||||
compile 'org.jsoup:jsoup:1.7.2'
|
||||
|
||||
testCompile 'org.robolectric:robolectric:3.0-rc3'
|
||||
|
|
|
@ -316,9 +316,9 @@ public class SubscriptionExpandableListAdapter extends BaseExpandableListAdapter
|
|||
viewHolder.imgView.setImageResource(R.drawable.ic_action_expand_less);
|
||||
|
||||
if(isExpanded) {
|
||||
rotation = 90;
|
||||
} else {
|
||||
rotation = 180;
|
||||
} else {
|
||||
rotation = 90;
|
||||
}
|
||||
|
||||
viewHolder.imgView.setOnClickListener(new OnClickListener() {
|
||||
|
|
|
@ -21,16 +21,12 @@
|
|||
|
||||
package de.luhmer.owncloudnewsreader;
|
||||
|
||||
import android.app.ActivityOptions;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
|
@ -53,6 +49,7 @@ import android.view.KeyEvent;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
@ -82,6 +79,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
*/
|
||||
SectionsPagerAdapter mSectionsPagerAdapter;
|
||||
@InjectView(R.id.toolbar) Toolbar toolbar;
|
||||
@InjectView(R.id.progressIndicator) ProgressBar progressIndicator;
|
||||
|
||||
/**
|
||||
* The {@link ViewPager} that will host the section contents.
|
||||
|
@ -100,6 +98,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
|
||||
private CustomTabsSession mCustomTabsSession;
|
||||
private CustomTabsClient mCustomTabsClient;
|
||||
private CustomTabsServiceConnection mCustomTabsConnection;
|
||||
|
||||
private boolean mCustomTabsSupported;
|
||||
//public static final String DATABASE_IDS_OF_ITEMS = "DATABASE_IDS_OF_ITEMS";
|
||||
|
@ -163,6 +162,8 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
// primary sections of the app.
|
||||
mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
|
||||
|
||||
progressIndicator.setMax(mSectionsPagerAdapter.getCount());
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = (ViewPager) findViewById(R.id.pager);
|
||||
mViewPager.setAdapter(mSectionsPagerAdapter);
|
||||
|
@ -187,10 +188,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
//TODO unbind service here.. Not implemented by google yet
|
||||
//if(mCustomTabsSupported)
|
||||
//unbindService();
|
||||
unbindCustomTabsService();
|
||||
}
|
||||
|
||||
private OnPageChangeListener onPageChangeListener = new OnPageChangeListener() {
|
||||
|
@ -228,8 +226,9 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
if(currentPosition < rssItems.size()-1)
|
||||
{
|
||||
mViewPager.setCurrentItem(currentPosition + 1, true);
|
||||
return true;
|
||||
}
|
||||
// capture event to avoid volume change at end of feed
|
||||
return true;
|
||||
}
|
||||
|
||||
else if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP))
|
||||
|
@ -237,8 +236,9 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
if(currentPosition > 0)
|
||||
{
|
||||
mViewPager.setCurrentItem(currentPosition - 1, true);
|
||||
return true;
|
||||
}
|
||||
// capture event to avoid volume change at beginning of feed
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(keyCode == KeyEvent.KEYCODE_BACK)
|
||||
|
@ -277,6 +277,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
StopVideoOnCurrentPage();
|
||||
currentPosition = position;
|
||||
ResumeVideoPlayersOnCurrentPage();
|
||||
progressIndicator.setProgress(position + 1);
|
||||
|
||||
if(!rssItems.get(position).getRead_temp())
|
||||
{
|
||||
|
@ -498,8 +499,7 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
if (packageName == null)
|
||||
return false;
|
||||
|
||||
return CustomTabsClient.bindCustomTabsService(
|
||||
this, packageName, new CustomTabsServiceConnection() {
|
||||
mCustomTabsConnection = new CustomTabsServiceConnection() {
|
||||
@Override
|
||||
public void onCustomTabsServiceConnected(ComponentName name, CustomTabsClient client) {
|
||||
mCustomTabsClient = client;
|
||||
|
@ -509,7 +509,19 @@ public class NewsDetailActivity extends PodcastFragmentActivity {
|
|||
public void onServiceDisconnected(ComponentName name) {
|
||||
mCustomTabsClient = null;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return CustomTabsClient.bindCustomTabsService(this, packageName, mCustomTabsConnection);
|
||||
}
|
||||
|
||||
private void unbindCustomTabsService() {
|
||||
if (mCustomTabsConnection == null)
|
||||
return;
|
||||
|
||||
unbindService(mCustomTabsConnection);
|
||||
mCustomTabsConnection = null;
|
||||
mCustomTabsClient = null;
|
||||
mCustomTabsSession = null;
|
||||
}
|
||||
|
||||
private CustomTabsSession getSession() {
|
||||
|
|
|
@ -235,6 +235,10 @@ public class NewsDetailFragment extends Fragment {
|
|||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
private void init_webView() {
|
||||
int backgroundColor = ColorHelper.getColorFromAttribute(getContext(),
|
||||
R.attr.news_detail_background_color);
|
||||
mWebView.setBackgroundColor(backgroundColor);
|
||||
|
||||
WebSettings webSettings = mWebView.getSettings();
|
||||
//webSettings.setPluginState(WebSettings.PluginState.ON);
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
|
|
|
@ -21,51 +21,49 @@
|
|||
|
||||
package de.luhmer.owncloudnewsreader;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager.LayoutParams;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import it.gmariotti.changelibs.library.view.ChangeLogListView;
|
||||
import java.io.IOException;
|
||||
import java.util.Formatter;
|
||||
|
||||
import de.luhmer.owncloudnewsreader.async_tasks.DownloadChangelogTask;
|
||||
import de.luhmer.owncloudnewsreader.view.ChangeLogFileListView;
|
||||
|
||||
/**
|
||||
* Activity which displays a login screen to the user, offering registration as
|
||||
* well.
|
||||
* Displays current app version and changelog.
|
||||
*/
|
||||
public class VersionInfoDialogFragment extends DialogFragment {
|
||||
|
||||
@SuppressLint("SetJavaScriptEnabled")
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
// Build the dialog and set up the button click handlers
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
// load views
|
||||
LayoutInflater inflater = getActivity().getLayoutInflater();
|
||||
final View view = inflater.inflate(R.layout.dialog_version_info, null);
|
||||
builder.setView(view).setTitle(getString(R.string.menu_About_Changelog));
|
||||
View view = inflater.inflate(R.layout.dialog_version_info, null);
|
||||
|
||||
try {
|
||||
PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
|
||||
String version = pInfo.versionName;
|
||||
((TextView)view.findViewById(R.id.tv_androidAppVersion)).setText("You're using Version " + version);
|
||||
ChangeLogFileListView clListView = (ChangeLogFileListView) view.findViewById(R.id.changelog_listview);
|
||||
final ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.changeLogLoadingProgressBar);
|
||||
TextView versionTextView = (TextView) view.findViewById(R.id.tv_androidAppVersion);
|
||||
|
||||
// build dialog
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity())
|
||||
.setView(view)
|
||||
.setTitle(getString(R.string.menu_About_Changelog));
|
||||
|
||||
ChangeLogListView clListView = (ChangeLogListView) view.findViewById(R.id.changelog_listview);
|
||||
clListView.setCallback(new ChangeLogListView.FinishedLoadingCallback() {
|
||||
@Override
|
||||
public void FinishedLoading() {
|
||||
view.findViewById(R.id.changeLogLoadingProgressBar).setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
// set current version
|
||||
versionTextView.setText(getVersionString());
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
// load changelog into view
|
||||
loadChangeLog(clListView, progressBar);
|
||||
|
||||
return builder.create();
|
||||
}
|
||||
|
@ -83,4 +81,37 @@ public class VersionInfoDialogFragment extends DialogFragment {
|
|||
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
private String getVersionString() {
|
||||
String version = "?";
|
||||
|
||||
try {
|
||||
PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
|
||||
version = pInfo.versionName;
|
||||
} catch (PackageManager.NameNotFoundException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Formatter formatter = new Formatter();
|
||||
String versionString = getString(R.string.current_version);
|
||||
return formatter.format(versionString, version).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads changelog into the given view and hides progress bar when done.
|
||||
*/
|
||||
private void loadChangeLog(ChangeLogFileListView clListView, final ProgressBar progressBar) {
|
||||
new DownloadChangelogTask(getContext(), clListView, new DownloadChangelogTask.Listener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(IOException e) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).execute();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,167 @@
|
|||
package de.luhmer.owncloudnewsreader.async_tasks;
|
||||
|
||||
import android.content.Context;
|
||||
import android.database.DataSetObserver;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import de.luhmer.owncloudnewsreader.view.ChangeLogFileListView;
|
||||
|
||||
/**
|
||||
* Downloads the owncloud news reader changelog from github, transforms it into xml
|
||||
* and saves it as tempfile. This xml tempfile can be used for changeloglib library.
|
||||
*/
|
||||
public class DownloadChangelogTask extends AsyncTask<Void, Void, String> {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static final String TAG = "DownloadChangelogTask";
|
||||
|
||||
private static final String README_URL = "https://raw.github.com/owncloud/News-Android-App/master/README.md";
|
||||
private static final String FILE_NAME = "changelog.xml";
|
||||
|
||||
private Context mContext;
|
||||
private ChangeLogFileListView mChangelogView;
|
||||
private Listener mListener;
|
||||
private IOException exception;
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* @param changelogView this list view will be automatically filled when
|
||||
* downloading and saving has finished
|
||||
* @param listener called when task has finished or errors have been raised
|
||||
*/
|
||||
public DownloadChangelogTask(Context context,
|
||||
ChangeLogFileListView changelogView,
|
||||
Listener listener) {
|
||||
mContext = context;
|
||||
mChangelogView = changelogView;
|
||||
mListener = listener;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
String path = null;
|
||||
|
||||
try {
|
||||
ArrayList<String> changelogArr = downloadReadme();
|
||||
String xml = convertToXML(changelogArr);
|
||||
path = saveToTempFile(xml, FILE_NAME);
|
||||
} catch (IOException e) {
|
||||
exception = e;
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String filePath) {
|
||||
if (exception != null) {
|
||||
mListener.onError(exception);
|
||||
return;
|
||||
}
|
||||
|
||||
mChangelogView.loadFile(filePath);
|
||||
mChangelogView.getAdapter().registerDataSetObserver(new DataSetObserver() {
|
||||
@Override
|
||||
public void onChanged() {
|
||||
mListener.onSuccess();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ArrayList<String> downloadReadme() throws IOException {
|
||||
ArrayList<String> changelogArr = new ArrayList<>();
|
||||
|
||||
URL url = new URL(README_URL);
|
||||
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
|
||||
try {
|
||||
InputStream isTemp = new BufferedInputStream(urlConnection.getInputStream());
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(isTemp));
|
||||
String inputLine;
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
changelogArr.add(inputLine.replace("<", "[").replace(">", "]"));
|
||||
}
|
||||
in.close();
|
||||
} finally {
|
||||
urlConnection.disconnect();
|
||||
}
|
||||
|
||||
return changelogArr;
|
||||
}
|
||||
|
||||
private String convertToXML(ArrayList<String> changelogArr) {
|
||||
// use changelog section exclusively
|
||||
int changelogStartIndex = changelogArr.indexOf("Updates") + 2;
|
||||
changelogArr.subList(0, changelogStartIndex).clear();
|
||||
changelogArr.add("");
|
||||
|
||||
// create xml nodes
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
builder.append("<changelog bulletedList=\"true\">");
|
||||
|
||||
boolean versionStarted = false;
|
||||
|
||||
for (String line : changelogArr) {
|
||||
if (line.startsWith("- ")) {
|
||||
// change entry
|
||||
builder.append("<changelogtext>");
|
||||
builder.append(line.substring(2).trim());
|
||||
builder.append("</changelogtext>");
|
||||
} else if (line.equals("")) {
|
||||
// version end
|
||||
if (versionStarted) {
|
||||
versionStarted = false;
|
||||
builder.append("</changelogversion>");
|
||||
}
|
||||
} else if (!line.contains("---------------------")) {
|
||||
// version start
|
||||
versionStarted = true;
|
||||
builder.append("<changelogversion versionName=\"" + line + "\">");
|
||||
}
|
||||
}
|
||||
|
||||
builder.append("</changelog>");
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
private String saveToTempFile(String content, String fileName) throws IOException {
|
||||
File file = File.createTempFile(fileName, null, mContext.getCacheDir());
|
||||
BufferedWriter out = new BufferedWriter(new FileWriter(file));
|
||||
|
||||
try {
|
||||
out.write(content);
|
||||
} finally {
|
||||
out.close();
|
||||
}
|
||||
|
||||
return "file://" + file.getAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
public interface Listener {
|
||||
|
||||
/**
|
||||
* Called when ChangeLogFileListView instance has successfully been updated.
|
||||
*/
|
||||
void onSuccess();
|
||||
|
||||
/**
|
||||
* Called when some error has been thrown during download, parsing or saving.
|
||||
*/
|
||||
void onError(IOException e);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
package de.luhmer.owncloudnewsreader.view;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
/**
|
||||
* Like a standard android progress bar but with an animated progress
|
||||
* on Honeycomb and above. Use it like a normal progress bar.
|
||||
*/
|
||||
public class AnimatingProgressBar extends ProgressBar {
|
||||
|
||||
/**
|
||||
* easing of the bar animation
|
||||
*/
|
||||
private static final Interpolator DEFAULT_INTERPOLATOR = new DecelerateInterpolator();
|
||||
|
||||
/**
|
||||
* animation dureation in milliseconds
|
||||
*/
|
||||
private static final int ANIMATION_DURATION = 350;
|
||||
|
||||
/**
|
||||
* Factor by which the progress bar resolution will be increased. E.g. the max
|
||||
* value is set to 5 and the resolution to 100: the bar can animate internally
|
||||
* between the values 0 and 500.
|
||||
*/
|
||||
private static final int RESOLUTION = 100;
|
||||
|
||||
private ValueAnimator animator;
|
||||
private ValueAnimator animatorSecondary;
|
||||
private boolean animate = true;
|
||||
|
||||
public AnimatingProgressBar(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
public AnimatingProgressBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public AnimatingProgressBar(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public boolean isAnimate() {
|
||||
return animate;
|
||||
}
|
||||
|
||||
public void setAnimate(boolean animate) {
|
||||
this.animate = animate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void setMax(int max) {
|
||||
super.setMax(max * RESOLUTION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int getMax() {
|
||||
return super.getMax() / RESOLUTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int getProgress() {
|
||||
return super.getProgress() / RESOLUTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int getSecondaryProgress() {
|
||||
return super.getSecondaryProgress() / RESOLUTION;
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
@Override
|
||||
public synchronized void setProgress(int progress) {
|
||||
if (!animate || android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
super.setProgress(progress);
|
||||
return;
|
||||
}
|
||||
|
||||
if (animator == null) {
|
||||
animator = ValueAnimator.ofInt(getProgress() * RESOLUTION, progress * RESOLUTION);
|
||||
animator.setInterpolator(DEFAULT_INTERPOLATOR);
|
||||
animator.setDuration(ANIMATION_DURATION);
|
||||
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
AnimatingProgressBar.super.setProgress((Integer) animation.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
animator.cancel();
|
||||
animator.setIntValues(getProgress() * RESOLUTION, progress * RESOLUTION);
|
||||
animator.start();
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
@Override
|
||||
public synchronized void setSecondaryProgress(int secondaryProgress) {
|
||||
if (!animate || android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
super.setSecondaryProgress(secondaryProgress);
|
||||
return;
|
||||
}
|
||||
|
||||
if (animatorSecondary == null) {
|
||||
animatorSecondary = ValueAnimator.ofInt(getSecondaryProgress() * RESOLUTION, secondaryProgress * RESOLUTION);
|
||||
animatorSecondary.setInterpolator(DEFAULT_INTERPOLATOR);
|
||||
animatorSecondary.setDuration(ANIMATION_DURATION);
|
||||
animatorSecondary.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator animation) {
|
||||
AnimatingProgressBar.super.setSecondaryProgress((Integer) animation.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
animatorSecondary.cancel();
|
||||
animatorSecondary.setIntValues(getSecondaryProgress() * RESOLUTION, secondaryProgress * RESOLUTION);
|
||||
animatorSecondary.start();
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
||||
if (animator != null) {
|
||||
animator.cancel();
|
||||
}
|
||||
if (animatorSecondary != null) {
|
||||
animatorSecondary.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package de.luhmer.owncloudnewsreader.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import it.gmariotti.changelibs.library.view.ChangeLogListView;
|
||||
|
||||
/**
|
||||
* Thin wrapper around changeloglib to load local xml files by path
|
||||
* after the view has already been instanciated.
|
||||
*/
|
||||
public class ChangeLogFileListView extends ChangeLogListView {
|
||||
|
||||
public ChangeLogFileListView(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public ChangeLogFileListView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public ChangeLogFileListView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param path local xml path staring with "file://"
|
||||
*/
|
||||
public void loadFile(String path) {
|
||||
mChangeLogFileResourceUrl = path;
|
||||
super.initAdapter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initAdapter() {
|
||||
// do nothing yet - will be called in loadFile()
|
||||
}
|
||||
}
|
|
@ -65,4 +65,12 @@
|
|||
|
||||
</de.luhmer.owncloudnewsreader.view.ZoomableRelativeLayout>
|
||||
|
||||
<de.luhmer.owncloudnewsreader.view.AnimatingProgressBar
|
||||
android:id="@+id/progressIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="-7dp"
|
||||
style="?android:attr/progressBarStyleHorizontal" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
|
@ -1,15 +1,3 @@
|
|||
<!--
|
||||
<WebView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context=".LoginActivity"
|
||||
android:id="@+id/login_form"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
</WebView>
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -30,10 +18,10 @@
|
|||
android:layout_gravity="center_vertical|center_horizontal"
|
||||
android:indeterminate="true" />
|
||||
|
||||
<view xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
class="it.gmariotti.changelibs.library.view.ChangeLogListView"
|
||||
<de.luhmer.owncloudnewsreader.view.ChangeLogFileListView
|
||||
android:id="@+id/changelog_listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</LinearLayout>
|
|
@ -9,10 +9,19 @@
|
|||
<string name="title_newsreader_detail">Detalle del Llector de noticies</string>
|
||||
<string name="empty_view_header">Información</string>
|
||||
<string name="empty_view_content">Nun hai nengún elementu equí</string>
|
||||
<string name="toast_GettingMoreItems">Descarga de más elementos aniciada ... Por favor espera.</string>
|
||||
<string name="tv_clickHereToOpenItem">Clic equí p\'abrir l\'artículu</string>
|
||||
<string name="no_wifi_available">Nun hai conexón WiFi</string>
|
||||
<string name="do_you_want_to_download_without_wifi">¿Quies baxar les semeyes ensin una conexón WiFi?</string>
|
||||
<plurals name="max_items_count_reached">
|
||||
<item quantity="one">Algamasti\'l tamañu máximu d\'elementos %d</item>
|
||||
<item quantity="other">Algamasti\'l tamañu máximu d\'elementos %d</item>
|
||||
</plurals>
|
||||
<string name="widget_header">Noticies ownCloud</string>
|
||||
<plurals name="message_bar_new_articles_available">
|
||||
<item quantity="one">%d elementos nuevos disponibles</item>
|
||||
<item quantity="other">%d elementos nuevos disponibles</item>
|
||||
</plurals>
|
||||
<string name="message_bar_reload">Recargar</string>
|
||||
<string name="allUnreadFeeds">Tolos temes ensin lleer</string>
|
||||
<string name="starredFeeds">Artículos destacaos</string>
|
||||
|
@ -41,9 +50,18 @@
|
|||
<string name="action_sync_settings">Axustes de sincronización</string>
|
||||
<string name="action_add_new_feed">Amestar feed nuevu</string>
|
||||
<string name="action_textToSpeech">Axuntar información</string>
|
||||
<plurals name="notification_new_items_ticker">
|
||||
<item quantity="one">Tienes %d elementos nuevos ensin lleer</item>
|
||||
<item quantity="other">Tienes %d elementos nuevos ensin lleer</item>
|
||||
</plurals>
|
||||
<plurals name="notification_new_items_text">
|
||||
<item quantity="one">%d elementos nuevos disponibles</item>
|
||||
<item quantity="other">%d elementos nuevos disponibles</item>
|
||||
</plurals>
|
||||
<!--Strings related to login-->
|
||||
<string name="pref_title_username">Nome d\'usuariu</string>
|
||||
<string name="pref_title_password">Contraseña</string>
|
||||
<string name="pref_title_owncloudRootPath">direición root d\'ownCloud</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">Aniciar sesión</string>
|
||||
|
@ -52,13 +70,26 @@
|
|||
<string name="error_field_required">Requierse esti campu</string>
|
||||
<string name="error_invalid_url">La url ye incorreuta</string>
|
||||
<!--Toast Messages-->
|
||||
<plurals name="toast_downloaded_x_items">
|
||||
<item quantity="one">Descargaos %d elementos vieyos</item>
|
||||
<item quantity="other">Descargaos %d elementos vieyos</item>
|
||||
</plurals>
|
||||
<string name="toast_no_more_downloads_available">Nun hai elementos disponibles</string>
|
||||
<string name="pull_to_refresh_updateTags">Sincronizando l\'estáu de los elementos</string>
|
||||
<string name="pull_to_refresh_updateFolder">Sincronizando carpeta</string>
|
||||
<string name="pull_to_refresh_updateFeeds">Sincronizando feeds</string>
|
||||
<string name="pull_to_refresh_updateItems">Sincronizando oxetos</string>
|
||||
<plurals name="fetched_items_so_far">
|
||||
<item quantity="one">Averaos %d elementos alloñaos...</item>
|
||||
<item quantity="other">Averaos %d elementos alloñaos...</item>
|
||||
</plurals>
|
||||
<!--Strings related to Settings-->
|
||||
<string name="title_activity_settings">Axustes</string>
|
||||
<string name="cache_is_cleared">¡Llimpióse la Cache!</string>
|
||||
<plurals name="number_of_files">
|
||||
<item quantity="one">%d Ficheros</item>
|
||||
<item quantity="other">%d Ficheros</item>
|
||||
</plurals>
|
||||
<!--General settings-->
|
||||
<string name="pref_header_general">Xeneral</string>
|
||||
<string name="pref_title_general_sort_order">Ordenar</string>
|
||||
|
@ -77,6 +108,8 @@
|
|||
<!--<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="dialog_clearing_cache">Llimpiando caché</string>
|
||||
<string name="dialog_clearing_cache_please_wait">Llimpiando cache... Por favor espera</string>
|
||||
<string name="calculating_cache_size">Calculando tamañu de cache... Por favor espera</string>
|
||||
<string name="reset_cache_unsaved_changes">Hai cambeos non sincronizaos. ¿Quies vaciar la caché de toes formes?</string>
|
||||
<string name="warning">Avisu</string>
|
||||
<string name="pref_title_AutoSyncOnStart">Sincronizar nel aniciu</string>
|
||||
|
@ -85,6 +118,7 @@
|
|||
<string name="pref_title_DisableHostnameVerification">Deshabilitar verificación de nome d\'agospiu</string>
|
||||
<string name="pref_title_NavigateWithVolumeButtons">Navegar colos botones de volume</string>
|
||||
<string name="pref_title_MarkAsReadWhileScrolling">Marcar como lleíu al desplazar</string>
|
||||
<string name="pref_title_OpenInBrowserDirectly">Usa restolador esternu pa ver los artículos</string>
|
||||
<string name="pref_title_notification_new_articles_available">Amosar notificación cuando tean disponibles artículos nuevos</string>
|
||||
<!--MemorizingTrustManager-->
|
||||
<string name="mtm_accept_cert">¿Aceutar certificáu desconocíu?</string>
|
||||
|
@ -109,6 +143,18 @@
|
|||
<item>0</item>
|
||||
<item>1</item>
|
||||
</string-array>
|
||||
<string-array name="pref_display_feed_list_layout">
|
||||
<item>Simple</item>
|
||||
<item>Estendíu</item>
|
||||
<item>Estendíu (too\'l testu)</item>
|
||||
<item>Estendiu con Visor Web</item>
|
||||
</string-array>
|
||||
<string-array name="pref_display_feed_list_layout_values">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>3</item>
|
||||
<item>2</item>
|
||||
</string-array>
|
||||
<string-array name="pref_title_lines_count">
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
|
|
|
@ -13,4 +13,6 @@
|
|||
|
||||
<attr name="tintColor" format="color" />
|
||||
|
||||
<attr name="news_detail_background_color" format="color" />
|
||||
|
||||
</resources>
|
|
@ -23,6 +23,10 @@
|
|||
|
||||
<color name="material_blue_900">#0d47a1</color>
|
||||
|
||||
<!-- see also assets/web.css -->
|
||||
<color name="news_detail_background_color_light_theme">#eeeeee</color>
|
||||
<color name="news_detail_background_color_dark_theme">#222222</color>
|
||||
|
||||
|
||||
|
||||
<color name="owncloudBlueLight">#35537A</color>
|
||||
|
@ -51,4 +55,7 @@
|
|||
|
||||
<color name="tintColorLight">@android:color/black</color>
|
||||
<color name="tintColorDark">@android:color/white</color>
|
||||
|
||||
<!-- override libs -->
|
||||
<color name="chglib_background_default_divider_color">#00000000</color>
|
||||
</resources>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<item quantity="one">You\'ve reached the maximum size of %d item</item>
|
||||
<item quantity="other">You\'ve reached the maximum size of %d items</item>
|
||||
</plurals>
|
||||
<string name="current_version">You\'re using Version %s</string>
|
||||
<string name="widget_header">ownCloud News</string>
|
||||
<plurals name="message_bar_new_articles_available">
|
||||
<item quantity="one">%d new item available</item>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
<item name="starredColor">@color/starredColorDark</item>
|
||||
<item name="unstarredColor">@color/unstarredColorDark</item>
|
||||
<item name="markasreadDrawable">@drawable/swipe_markasread</item>
|
||||
|
||||
<item name="news_detail_background_color">@color/news_detail_background_color_dark_theme</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
@ -45,6 +47,8 @@
|
|||
<item name="starredColor">@color/starredColorLight</item>
|
||||
<item name="unstarredColor">@color/unstarredColorLight</item>
|
||||
<item name="markasreadDrawable">@drawable/swipe_markasread_light</item>
|
||||
|
||||
<item name="news_detail_background_color">@color/news_detail_background_color_light_theme</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
|
|
Loading…
Reference in a new issue