Skip to content

Commit

Permalink
Merge pull request #3856 from wordpress-mobile/issue/3791-support-lib…
Browse files Browse the repository at this point in the history
…rary-23.2

Updating support library to 23.4
  • Loading branch information
maxme committed May 19, 2016
2 parents d7acb8f + d151e7d commit 6354ee3
Show file tree
Hide file tree
Showing 131 changed files with 218 additions and 198 deletions.
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ A number of library dependencies are managed as separate open source projects an

$ git subtree pull --squash --prefix libs/library_name https://github.com/wordpress-mobile/WordPress-Library_Name-Android.git develop

and substitute the `library_name` and `Library_Name` to match the library project. As an example, for the Analytics library use 'analytics' and 'Analytics` respectively.
and substitute the `library_name` and `Library_Name` to match the library project. As an example, for the Analytics library use 'analytics' and 'Analytics' respectively.

Similarly, issue a `subtree push` to push changes committed to the main app repo, upstream to the library repo:

Expand All @@ -79,10 +79,9 @@ Here are the libraries currently maintained and subtree'd:

# Drawable Resources

The Android build tools now allow drawable resources to be provided exclusively in vector format, PNG's are automatically generated at build time if necessary.
The Android support library [v23.2.1](http://android-developers.blogspot.com/2016/02/android-support-library-232.html) added support for drawable resources to be provided exclusively in vector format. Adding a vector drawable (to `WordPress/src/main/res/drawable/`) should be the first option when adding assets. Only if a vector drawable is not available should pngs be added to the project. Also make sure to use `app:srcCompat` in place of `android:src` in XML files.

From the [release notes](http://tools.android.com/tech-docs/new-build-system):
`PNGs are generated for every vector drawable found in a resource directory that does not specify an API version (or specifies a version lower than 21).`
Since Vector Drawable are not the easiest file type to edit, they're chances the Vector Drawable you'll add comes from a SVG file. If the SVG file is specific to the WPAndroid project (like a banner image or unlike a gridicon), then add the SVG source in `WordPress/src/future/svg/`. The argument behind this: make sure we can find and edit the SVG file and then export it in Vector Drawable format.

# Subtree'd projects

Expand Down
17 changes: 9 additions & 8 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ android {
minSdkVersion 14
targetSdkVersion 23

vectorDrawables.useSupportLibrary = true
buildConfigField "boolean", "VISUAL_EDITOR_AVAILABLE", "false"
buildConfigField "boolean", "IN_APP_BILLING_AVAILABLE", "false"
}
Expand Down Expand Up @@ -87,14 +88,14 @@ dependencies {
}
compile 'com.google.code.gson:gson:2.6.+'
compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
compile 'com.android.support:support-v13:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:percent:23.1.1'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-auth:8.3.0'
compile 'com.android.support:support-v13:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:percent:23.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
compile 'com.github.chrisbanes.photoview:library:1.2.4'
compile 'com.helpshift:android-helpshift-aar:4.4.0'
compile 'de.greenrobot:eventbus:2.4.0'
Expand Down
4 changes: 4 additions & 0 deletions WordPress/lint.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
<issue id="IconDipSize" severity="error" />
<issue id="InconsistentArrays" severity="error" />
<issue id="StringFormatCount" severity="error" />

<issue id="MissingPrefix">
<ignore regexp="Unexpected namespace prefix &quot;app&quot; found for tag `Image.*`" />
</issue>
</lint>
12 changes: 0 additions & 12 deletions WordPress/src/future/gridicons_clipboard.svg

This file was deleted.

Binary file removed WordPress/src/future/res/drawable-xxxhdpi/arrow.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
15 changes: 0 additions & 15 deletions WordPress/src/future/res/gridicons_history.svg
Diff not rendered.
11 changes: 0 additions & 11 deletions WordPress/src/future/res/gridicons_trash.svg
Diff not rendered.
1 change: 1 addition & 0 deletions WordPress/src/future/svg/stats_widget_promo_header.svg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.wordpress.android.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.optimizely.Optimizely;

Expand All @@ -14,7 +14,7 @@
import org.wordpress.android.util.ToastUtils;
import org.wordpress.android.util.WPOptimizelyEventListener;

public class WPLaunchActivity extends Activity {
public class WPLaunchActivity extends AppCompatActivity {

/*
* this the main (default) activity, which does nothing more than launch the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;

import com.google.android.gms.auth.api.credentials.Credential;
Expand All @@ -17,7 +17,7 @@
import org.wordpress.android.util.AppLog;
import org.wordpress.android.util.AppLog.T;

public class SignInActivity extends FragmentActivity {
public class SignInActivity extends AppCompatActivity {
public static final int SIGN_IN_REQUEST = 1;
public static final int REQUEST_CODE = 5000;
public static final int ADD_SELF_HOSTED_BLOG = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.wordpress.android.ui.main;

import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.DialogFragment;
import android.app.Fragment;
import android.content.Intent;
Expand All @@ -11,6 +10,7 @@
import android.os.Handler;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
Expand Down Expand Up @@ -62,7 +62,7 @@
/**
* Main activity which hosts sites, reader, me and notifications tabs
*/
public class WPMainActivity extends Activity implements Bucket.Listener<Note> {
public class WPMainActivity extends AppCompatActivity implements Bucket.Listener<Note> {

private WPViewPager mViewPager;
private WPMainTabLayout mTabLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.app.Dialog;
import android.app.DialogFragment;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.graphics.drawable.VectorDrawableCompat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -56,7 +58,8 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
Button btn = (Button) view.findViewById(R.id.promo_dialog_cancel_button);
btn.setText(mButtonLabelId);
ImageView image = (ImageView) view.findViewById(R.id.promo_dialog_image);
image.setImageDrawable(getResources().getDrawable(mDrawableId));
Drawable drawable = VectorDrawableCompat.create(getResources(), mDrawableId, null);
image.setImageDrawable(drawable);
WPTextView title = (WPTextView) view.findViewById(R.id.promo_dialog_title);
title.setText(mTitleId);
WPTextView desc = (WPTextView) view.findViewById(R.id.promo_dialog_description);
Expand Down
Diff not rendered.
Diff not rendered.
Diff not rendered.
Loading

0 comments on commit 6354ee3

Please sign in to comment.