Skip to content

Commit

Permalink
Version 3.20.2 patch release
Browse files Browse the repository at this point in the history
- Fixed issue loading and copying multi paths with proceeding slash.
- Fixed imgur regex detection to include sub domains.
- Added ime action to multi dialog EditText elements.
- Updated Android SDK and support libraries.
  • Loading branch information
micwallace committed Oct 31, 2016
1 parent 46106b0 commit 64c7e9c
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 62 deletions.
10 changes: 5 additions & 5 deletions reddinator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.android.tools.build:gradle:2.2.2'
}
}

Expand All @@ -17,11 +17,11 @@ repositories {
}

android {
compileSdkVersion 24
compileSdkVersion 25
buildToolsVersion '21.1.2'
defaultConfig {
minSdkVersion 11
targetSdkVersion 24
targetSdkVersion 25
return
}
signingConfigs {
Expand All @@ -47,8 +47,8 @@ android {


dependencies {
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.joanzapata.android:android-iconify:1.0.11'
Expand Down
56 changes: 28 additions & 28 deletions reddinator/reddinator-reddinator.iml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@
<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/shaders" isTestSource="false" />
<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/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" 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" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
Expand All @@ -82,21 +74,29 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<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/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" 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" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/24.2.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/25.0.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.kobakei/ratethisapp/0.0.4/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.larswerkman/HoloColorPicker/1.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.sothree.slidinguppanel/library/3.3.1/jars" />
Expand All @@ -122,28 +122,28 @@
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-annotations-25.0.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.9.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
<orderEntry type="library" exported="" name="android-iconify-1.0.11" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-24.2.1" level="project" />
<orderEntry type="library" exported="" name="HoloColorPicker-1.5" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-25.0.0" level="project" />
<orderEntry type="library" exported="" name="support-media-compat-25.0.0" level="project" />
<orderEntry type="library" exported="" name="support-compat-25.0.0" level="project" />
<orderEntry type="library" exported="" name="support-fragment-25.0.0" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-25.0.0" level="project" />
<orderEntry type="library" exported="" name="library-3.3.1" level="project" />
<orderEntry type="library" exported="" name="option-1.3" level="project" />
<orderEntry type="library" exported="" name="ckchangelog-1.2.2" level="project" />
<orderEntry type="library" exported="" name="library-3.2" level="project" />
<orderEntry type="library" exported="" name="support-core-ui-25.0.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-3.4.1" level="project" />
<orderEntry type="library" exported="" name="ratethisapp-0.0.4" level="project" />
<orderEntry type="library" exported="" name="commons-lang3-3.4" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.4.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-25.0.0" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-25.0.0" level="project" />
<orderEntry type="library" exported="" name="support-core-utils-25.0.0" level="project" />
</component>
</module>
Binary file modified reddinator/reddinator-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions reddinator/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="au.com.wallaceit.reddinator"
android:versionCode="58"
android:versionName="3.20.1">
android:versionCode="59"
android:versionName="3.20.2">

<uses-permission android:name="android.permission.INTERNET" />
<!-- Needed by some activity_webview HTML5 video implementations (Bug report received for Android 4.1) -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,6 @@ public static boolean doShowWelcomeDialog(final Activity context){

SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);

// TODO: Remove backward compatability in version 3.21.0
boolean aboutDismissed = preferences.getBoolean("changelogDialogShown-3.20", false);
if (aboutDismissed) return false;

String lastVersion = preferences.getString("changelogLastVersion", "");
String thisVersion = Utilities.getPackageInfo(context).versionName;
// Only show changelog if major or minor version has changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.text.InputType;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -46,6 +47,7 @@
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
Expand Down Expand Up @@ -273,7 +275,6 @@ public void onResume(){
multiSubsAdapter.refreshList();
} else {
isCreated = true;
System.out.print("IS CREATED!!");
}
}

Expand Down Expand Up @@ -952,6 +953,15 @@ public void onClick(View v) {
public void onClick(View v) {
LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.dialog_multi_add, parent, false);
final EditText name = (EditText) layout.findViewById(R.id.new_multi_name);
name.setSingleLine();
name.setImeOptions(EditorInfo.IME_ACTION_GO);
name.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
createMulti(name.getText().toString());
return false;
}
});
AlertDialog.Builder builder = new AlertDialog.Builder(SubredditSelectActivity.this);
builder.setTitle(resources.getString(R.string.create_a_multi)).setView(layout)
.setNegativeButton(resources.getString(R.string.cancel), new DialogInterface.OnClickListener() {
Expand All @@ -962,11 +972,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
}).setPositiveButton(resources.getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (name.getText().toString().equals("")) {
Toast.makeText(SubredditSelectActivity.this, resources.getString(R.string.enter_multi_name_error), Toast.LENGTH_LONG).show();
return;
}
new SubscriptionEditTask(global, SubredditSelectActivity.this, SubredditSelectActivity.this, SubscriptionEditTask.ACTION_MULTI_CREATE).execute(name.getText().toString());
createMulti(name.getText().toString());
dialogInterface.dismiss();
}
}).show().setCanceledOnTouchOutside(true);
Expand Down Expand Up @@ -1024,6 +1030,14 @@ public void onClick(View view) {
return convertView;
}

private void createMulti(String name){
if (name.equals("")) {
Toast.makeText(SubredditSelectActivity.this, resources.getString(R.string.enter_multi_name_error), Toast.LENGTH_LONG).show();
return;
}
new SubscriptionEditTask(global, SubredditSelectActivity.this, SubredditSelectActivity.this, SubscriptionEditTask.ACTION_MULTI_CREATE).execute(name);
}

@Override
public int getCount() {
return multiList.size()+1;
Expand Down Expand Up @@ -1279,20 +1293,24 @@ public View getView(int position, View convertView, final ViewGroup parent) {
viewHolder.nameInput.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
String subreddit = viewHolder.nameInput.getText().toString();
performAdd(subreddit);
performAdd(viewHolder.nameInput.getText().toString());
viewHolder.nameInput.setText("");
}
});
viewHolder.nameInput.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO){
performAdd(viewHolder.nameInput.getText().toString());
viewHolder.nameInput.setText("");
}
return false;
}
});
viewHolder.addIcon.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
String subreddit = viewHolder.nameInput.getText().toString();
if (subreddit.equals("")){
Toast.makeText(SubredditSelectActivity.this, resources.getString(R.string.sub_name_error), Toast.LENGTH_SHORT).show();
return;
}
performAdd(subreddit);
performAdd(viewHolder.nameInput.getText().toString());
viewHolder.nameInput.setText("");
}
});
Expand Down Expand Up @@ -1331,7 +1349,10 @@ private ArrayList<String> getSubsList(){
}

private void performAdd(String subreddit){
//System.out.println("Adding Sub: " + subreddit);
if (subreddit.equals("")){
Toast.makeText(SubredditSelectActivity.this, resources.getString(R.string.sub_name_error), Toast.LENGTH_SHORT).show();
return;
}
if (mode==MODE_MULTI) {
new SubscriptionEditTask(global, SubredditSelectActivity.this, SubredditSelectActivity.this, SubscriptionEditTask.ACTION_MULTI_SUB_ADD).execute(multiPath, subreddit);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected void onCreate(Bundle savedInstanceState) {
String imageUrl = getIntent().getStringExtra(Reddinator.ITEM_URL);
// fix imgur links so it's not redirected to full webpage
if (Utilities.isImgurUrl(imageUrl)) {
imageUrl = imageUrl.replace("//imgur.com/", "//i.imgur.com/");
imageUrl = imageUrl.replaceFirst("//*.imgur.com/", "//i.imgur.com/");
if (!Utilities.hasImageExtension(imageUrl))
imageUrl += ".jpg"; // any extension will work
}
Expand All @@ -67,7 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
boolean multi = getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
webView.getSettings().setDisplayZoomControls(!multi);
// Make sure we specify a proper user agent. Many sites block generic ones.
webView.getSettings().setUserAgentString("Android/Reddinator v3.11");
webView.getSettings().setUserAgentString("Android/Reddinator v3.20.2");
webView.loadUrl(imageUrl);
registerForContextMenu(webView);
// setup open comments button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ public boolean isFeedMulti(int feedId){
// this sets the current feed using the supplied name, reddit url path and isMulti value.
// isMulti is used to determine whether the items are from a different subreddit, in order to show that value to the user
public void setFeed(int feedId, String name, String path, boolean isMulti){
if (path.length()>1 && '/' == (path.charAt(path.length()-1)))
path = path.substring(0, path.length()-1);

JSONObject data = new JSONObject();
try {
data.put("name", name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ private static long dirSize(File dir) {
}

public static boolean isFeedPathMulti(String feedUrl){
return feedUrl.matches("(.*reddit.com)?/user/[^/]*/m/[^/]*");
return feedUrl.matches("(.*reddit.com)?/user/[^/]*/m/[^/]*/?");
}

public static boolean isFeedPathDomain(String feedUrl){
return feedUrl.matches("(.*reddit.com)?/domain/[^/]*");
return feedUrl.matches("(.*reddit.com)?/domain/[^/]*/?");
}

public static boolean isImageUrl(String url) {
Expand All @@ -157,7 +157,7 @@ public static boolean isImageUrl(String url) {

public static boolean isImgurUrl(String url){
// Check for imgur url without file extension (should not be album)
return url.toLowerCase().matches("(https?://(.*imgur.com/[^galery/][^a/].*)$)");
return url.toLowerCase().matches("(https?://.*(imgur.com/(?!galery/|a/).*)$)");
}

public static boolean hasImageExtension(String url){
Expand Down
Loading

0 comments on commit 64c7e9c

Please sign in to comment.