Commit 25084e7a authored by Robert Hitt's avatar Robert Hitt

Updated Realm and support libraries

-Only real difference is that RecyclerView items are animated upon
removal
-Also, the color of the favorite button eases in when pressed. No idea
how this happened. I guess it is related to some support library change?
Possibly related to this, the ImageButton can no longer be focused.
parent 3e208b4d
Pipeline #1007 passed with stages
in 5 minutes and 6 seconds
......@@ -32,15 +32,15 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'io.realm:android-adapters:1.4.0'
compile 'io.realm:android-adapters:2.0.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.4'
testCompile 'junit:junit:4.12'
......
......@@ -50,15 +50,16 @@ public class FacilityListAdapter extends
private String mMode;
private Realm mRealm;
private Context mContext;
private Activity mActivity; // this is pretty much just for transition animations
// Mode describes the filtering for the elements to be displayed
public FacilityListAdapter(Context context,
OrderedRealmCollection<Facility> data,
public FacilityListAdapter(Context context, OrderedRealmCollection<Facility> data,
String mode, Realm realm, Activity activity) {
super(context, data, true);
super(data, true);
mContext = context;
mMode = mode;
mRealm = realm;
mActivity = activity;
......@@ -84,10 +85,10 @@ public class FacilityListAdapter extends
if (facility.isOpen()) {
// set the RV cell to be highlighted
holder.itemView.setBackgroundColor(ContextCompat
.getColor(context, R.color.facilityOpen));
.getColor(mContext, R.color.facilityOpen));
} else {
holder.itemView.setBackgroundColor(ContextCompat
.getColor(context, R.color.facilityClosed));
.getColor(mContext, R.color.facilityClosed));
}
if (facility.isFavorited()) {
......@@ -103,7 +104,7 @@ public class FacilityListAdapter extends
// Sets the duration text according to the user's settings
private void displayStatusDurationText(Facility facility, ViewHolder holder) {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext);
String setting = preferences.getString("list_view_information_preference",
"display_duration_both");
......@@ -139,7 +140,7 @@ public class FacilityListAdapter extends
// Helper method to set the facility item layout's padding
// Have to convert from pixels to dp
private void setItemPaddingInDp(LinearLayout layout, int paddingPx) {
float scale = context.getResources().getDisplayMetrics().density;
float scale = mContext.getResources().getDisplayMetrics().density;
int paddingTop = (int) (paddingPx * scale + 0.5f);
int paddingBottom = (int) (paddingPx * scale + 0.5f);
......@@ -230,7 +231,7 @@ public class FacilityListAdapter extends
// transitions to the facility's detail view
@OnClick(R.id.text_layout)
public void expandFacilityView() {
Intent intent = new Intent(context, DetailActivity.class);
Intent intent = new Intent(mContext, DetailActivity.class);
intent.putExtra("name", data.getName());
// for some reason I need this for the transition to work
......@@ -238,7 +239,7 @@ public class FacilityListAdapter extends
ActivityOptionsCompat transitionActivityOptions =
ActivityOptionsCompat.makeSceneTransitionAnimation(mActivity, p1);
context.startActivity(intent, transitionActivityOptions.toBundle());
mContext.startActivity(intent, transitionActivityOptions.toBundle());
}
// toggles favorite status
......@@ -257,7 +258,7 @@ public class FacilityListAdapter extends
@Override
public Context getContext() {
return context;
return mContext;
}
}
}
......@@ -8,7 +8,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "io.realm:realm-gradle-plugin:2.2.1"
classpath "io.realm:realm-gradle-plugin:3.0.0"
classpath 'me.tatarka:gradle-retrolambda:3.3.1'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment