diff --git a/README.md b/README.md
index 8fc0556..a22681c 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
# FlipView
-###### GMail-like View & beyond - v1.1.3 built on 2017.03.07
+###### GMail-like View & beyond - v1.2.0 built on 2018.09.30 with AndroidX
#### Concept
FlipView is a ViewGroup (FrameLayout) that is designed to display 2 views/layouts by flipping
@@ -35,7 +35,7 @@ which means you can call all public functions of these two Android views.
Import the library into your project using JCenter
```
dependencies {
- implementation 'eu.davidea:flipview:1.1.3'
+ implementation 'eu.davidea:flipview:1.2.0'
}
```
#### Pull requests / Issues / Improvement requests
@@ -45,9 +45,9 @@ Feel free to contribute and ask!
Supported attributes with _default_ values:
``` xml
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android usual attrs
+ (see below).../>
```
|**ViewAnimator**||
|:---|:---|
@@ -98,9 +98,10 @@ Supported attributes with _default_ values:
# Change Log
###### Latest release
-[v1.1.3](https://github.com/davideas/FlipView/releases) - 2017.03.07
+[v1.2.0](https://github.com/davideas/FlipView/releases) - 2018.09.30
###### Old releases
+[v1.1.3](https://github.com/davideas/FlipView/releases/tag/1.1.3) - 2017.03.07 |
[v1.1.2](https://github.com/davideas/FlipView/releases/tag/1.1.2) - 2016.11.30 |
[v1.1.1](https://github.com/davideas/FlipView/releases/tag/1.1.1) - 2016.04.07
[v1.1.0](https://github.com/davideas/FlipView/releases/tag/1.1.0) - 2015.11.05 |
diff --git a/build.gradle b/build.gradle
index bb1ed2f..61d1f5a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,9 +6,9 @@ ext {
developerEmail = 'dave.dna@gmail.com'
// Library
- libraryCode = 5
- libraryVersion = '1.1.3'
- libraryDate = " of 2017.03.07"
+ libraryCode = 6
+ libraryVersion = '1.2.0'
+ libraryDate = " of 2018.09.30"
libraryName = 'FlipView'
libraryDescription = 'Flipping views like GMail & beyond'
@@ -20,21 +20,26 @@ ext {
siteUrl = 'https://github.com/davideas/FlipView'
gitUrl = 'https://github.com/davideas/FlipView.git'
- // Support and Build tools version
+ // SDK and Build tools version
minSdk = 14
- targetSdk = 27
- buildTools = "27.0.3"
- supportLibrary = '27.1.1'
+ targetSdk = 28 // Android Pie
+ buildTools = "28.0.3"
- // Support Libraries dependencies
- supportDependencies = [
- design : "com.android.support:design:${supportLibrary}",
- recyclerview: "com.android.support:recyclerview-v7:${supportLibrary}",
- cardview : "com.android.support:cardview-v7:${supportLibrary}",
- appcompat : "com.android.support:appcompat-v7:${supportLibrary}",
- customtabs : "com.android.support:customtabs:${supportLibrary}",
- support : "com.android.support:support-v13:${supportLibrary}",
- annotations : "com.android.support:support-annotations:${supportLibrary}"
+ // AndroidX
+ androidxVer = "1.0.0"
+ constraintVer = "1.1.2"
+ androidx = [
+ recyclerView : "androidx.recyclerview:recyclerview:${androidxVer}",
+ appCompat : "androidx.appcompat:appcompat:${androidxVer}",
+ cardView : "androidx.cardview:cardview:${androidxVer}",
+ annotation : "androidx.annotation:annotation:${androidxVer}",
+ constraintLayout: "com.android.support.constraint:constraint-layout:${constraintVer}"
+ ]
+
+ // Google Material
+ googleVer = "1.0.0"
+ google = [
+ material: "com.google.android.material:material:${androidxVer}"
]
licenseName = 'The Apache Software License, Version 2.0'
@@ -48,8 +53,8 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.0'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ classpath 'com.android.tools.build:gradle:3.2.0'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/flipview-app/build.gradle b/flipview-app/build.gradle
index ec95833..8b13c8e 100644
--- a/flipview-app/build.gradle
+++ b/flipview-app/build.gradle
@@ -22,10 +22,8 @@ android {
dependencies {
//See main build.gradle for values & versions
implementation project(':flipview')
- implementation(supportDependencies.appcompat) {
- transitive = true
- }
- implementation supportDependencies.recyclerview
- implementation supportDependencies.design
+ implementation androidx.appCompat
+ implementation androidx.recyclerView
+ implementation google.material
}
\ No newline at end of file
diff --git a/flipview-app/src/main/java/eu/davidea/examples/flipview/FlipViewAdapter.java b/flipview-app/src/main/java/eu/davidea/examples/flipview/FlipViewAdapter.java
index 2f3557b..619e21d 100644
--- a/flipview-app/src/main/java/eu/davidea/examples/flipview/FlipViewAdapter.java
+++ b/flipview-app/src/main/java/eu/davidea/examples/flipview/FlipViewAdapter.java
@@ -1,6 +1,5 @@
package eu.davidea.examples.flipview;
-import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -9,6 +8,7 @@
import java.util.ArrayList;
import java.util.List;
+import androidx.recyclerview.widget.RecyclerView;
import eu.davidea.flipview.FlipView;
public class FlipViewAdapter extends RecyclerView.Adapter {
diff --git a/flipview-app/src/main/java/eu/davidea/examples/flipview/MainActivity.java b/flipview-app/src/main/java/eu/davidea/examples/flipview/MainActivity.java
index 4c483b2..bd0ba86 100644
--- a/flipview-app/src/main/java/eu/davidea/examples/flipview/MainActivity.java
+++ b/flipview-app/src/main/java/eu/davidea/examples/flipview/MainActivity.java
@@ -1,16 +1,10 @@
package eu.davidea.examples.flipview;
+import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
-import android.support.design.widget.FloatingActionButton;
-import android.support.design.widget.Snackbar;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.AppCompatCheckBox;
-import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
@@ -18,108 +12,117 @@
import android.widget.CheckBox;
import android.widget.CompoundButton;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.android.material.snackbar.Snackbar;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.widget.AppCompatCheckBox;
+import androidx.appcompat.widget.Toolbar;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
import eu.davidea.flipview.FlipView;
import eu.davidea.utils.Utils;
@SuppressWarnings("ConstantConditions")
public class MainActivity extends AppCompatActivity {
- private static final String HTTPS = "https://";
- private static final String URL = "github.com/davideas/FlipView";
- private static final int ITEMS = 15;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- //Enable DEBUG logs at runtime
- FlipView.enableLogs(true);
-
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
-
- FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
- fab.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- Snackbar.make(view, URL, Snackbar.LENGTH_LONG)
- .setAction("Github", new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent intent = new Intent(Intent.ACTION_VIEW);
- intent.setData(Uri.parse(HTTPS+URL));
- startActivity(Intent.createChooser(intent, getString(R.string.intent_chooser)));
- }
- }).show();
- }
- });
-
- initializeRecyclerView();
-
- //Example to set background color to the front layout programmatically
- FlipView flipView = (FlipView) findViewById(R.id.flip_horizontal_oval_view_big);
- flipView.setChildBackgroundColor(FlipView.FRONT_VIEW_INDEX, Color.RED);
-
- //Handling flipping programmatically
- AppCompatCheckBox enableCheckBox = (AppCompatCheckBox) findViewById(R.id.flag_enable);
- enableCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
- //FlipView to enable/disable
- findViewById(R.id.flip_layout).setEnabled(!isChecked);
- FlipView flipView = (FlipView) findViewById(R.id.flip_horizontal_oval_view_locked);
- flipView.setClickable(isChecked);//View was set not clickable in the layout!
-
- if (isChecked) {
- flipView.setChildBackgroundColor(0, getResources().getColor(R.color.colorAccent));
- flipView.setFrontImage(R.drawable.ic_lock_open_white_24dp);
- findViewById(R.id.triangle).setBackgroundResource(R.drawable.triangle_red);
- } else {
- flipView.setChildBackgroundDrawable(0, R.drawable.circle_light_stroke);
- flipView.setFrontImage(R.drawable.ic_lock_white_24dp);
- findViewById(R.id.triangle).setBackgroundResource(R.drawable.triangle_green);
- }
- Log.d(MainActivity.class.getSimpleName(), isChecked ? "Layout pinned, FlipView unlocked" : "Layout auto-flip, FlipView locked");
- }
- });
- }
-
- private void initializeRecyclerView() {
- FlipViewAdapter adapter = new FlipViewAdapter(ITEMS);
- RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
- recyclerView.setLayoutManager(new GridLayoutManager(this, ITEMS/3));
- recyclerView.setHasFixedSize(true);
- recyclerView.setAdapter(adapter);
- }
-
- public void showList(View view) {
- CheckBox checkBoxReset = (CheckBox) findViewById(R.id.checkbox_reset);
- if (checkBoxReset.isChecked()) FlipView.resetLayoutAnimationDelay();
- initializeRecyclerView();
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- getMenuInflater().inflate(R.menu.menu_main, menu);
- return true;
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- int id = item.getItemId();
- if (id == R.id.action_about) {
- MessageDialog.newInstance(
- R.drawable.ic_info_grey600_24dp,
- getString(R.string.about_title),
- getString(R.string.about_body,
- Utils.getVersionName(this),
- Utils.getVersionCode(this)) )
- .show(getFragmentManager(), MessageDialog.TAG);
- return true;
- }
-
- return super.onOptionsItemSelected(item);
- }
+ private static final String HTTPS = "https://";
+ private static final String URL = "github.com/davideas/FlipView";
+ private static final int ITEMS = 15;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ //Enable DEBUG logs at runtime
+ FlipView.enableLogs(true);
+
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Snackbar.make(view, URL, Snackbar.LENGTH_LONG)
+ .setAction("Github", new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse(HTTPS + URL));
+ startActivity(Intent.createChooser(intent, getString(R.string.intent_chooser)));
+ }
+ }).show();
+ }
+ });
+
+ initializeRecyclerView();
+
+ //Example to set background color to the front layout programmatically
+ FlipView flipView = (FlipView) findViewById(R.id.flip_horizontal_oval_view_big);
+ flipView.setChildBackgroundColor(FlipView.FRONT_VIEW_INDEX, Color.RED);
+
+ //Handling flipping programmatically
+ AppCompatCheckBox enableCheckBox = (AppCompatCheckBox) findViewById(R.id.flag_enable);
+ enableCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ //FlipView to enable/disable
+ findViewById(R.id.flip_layout).setEnabled(!isChecked);
+ FlipView flipView = (FlipView) findViewById(R.id.flip_horizontal_oval_view_locked);
+ flipView.setClickable(isChecked);//View was set not clickable in the layout!
+
+ if (isChecked) {
+ flipView.setChildBackgroundColor(0, getResources().getColor(R.color.colorAccent));
+ flipView.setFrontImage(R.drawable.ic_lock_open_white_24dp);
+ findViewById(R.id.triangle).setBackgroundResource(R.drawable.triangle_red);
+ } else {
+ flipView.setChildBackgroundDrawable(0, R.drawable.circle_light_stroke);
+ flipView.setFrontImage(R.drawable.ic_lock_white_24dp);
+ findViewById(R.id.triangle).setBackgroundResource(R.drawable.triangle_green);
+ }
+ Log.d(MainActivity.class.getSimpleName(), isChecked ? "Layout pinned, FlipView unlocked" : "Layout auto-flip, FlipView locked");
+ }
+ });
+ }
+
+ private void initializeRecyclerView() {
+ FlipViewAdapter adapter = new FlipViewAdapter(ITEMS);
+ RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
+ recyclerView.setLayoutManager(new GridLayoutManager(this, ITEMS / 3));
+ recyclerView.setHasFixedSize(true);
+ recyclerView.setAdapter(adapter);
+ }
+
+ public void showList(View view) {
+ CheckBox checkBoxReset = (CheckBox) findViewById(R.id.checkbox_reset);
+ if (checkBoxReset.isChecked()) FlipView.resetLayoutAnimationDelay();
+ initializeRecyclerView();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+ return true;
+ }
+
+ @SuppressLint("StringFormatMatches")
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+ if (id == R.id.action_about) {
+ MessageDialog.newInstance(
+ R.drawable.ic_info_grey600_24dp,
+ getString(R.string.about_title),
+ getString(R.string.about_body,
+ Utils.getVersionName(this),
+ Utils.getVersionCode(this)))
+ .show(getFragmentManager(), MessageDialog.TAG);
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
}
\ No newline at end of file
diff --git a/flipview-app/src/main/java/eu/davidea/examples/flipview/MessageDialog.java b/flipview-app/src/main/java/eu/davidea/examples/flipview/MessageDialog.java
index fa7c829..a65a0c4 100644
--- a/flipview-app/src/main/java/eu/davidea/examples/flipview/MessageDialog.java
+++ b/flipview-app/src/main/java/eu/davidea/examples/flipview/MessageDialog.java
@@ -6,7 +6,7 @@
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
-import android.support.v7.app.AlertDialog;
+import androidx.appcompat.app.AlertDialog;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
diff --git a/flipview-app/src/main/res/layout/activity_main.xml b/flipview-app/src/main/res/layout/activity_main.xml
index 2fc5ea4..5bcf0c0 100644
--- a/flipview-app/src/main/res/layout/activity_main.xml
+++ b/flipview-app/src/main/res/layout/activity_main.xml
@@ -1,5 +1,5 @@
-
-
-
-
+
-
@@ -38,9 +38,9 @@
-
+
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/flipview-app/src/main/res/layout/content_flipviews.xml b/flipview-app/src/main/res/layout/content_flipviews.xml
index 3e43672..cc94c76 100644
--- a/flipview-app/src/main/res/layout/content_flipviews.xml
+++ b/flipview-app/src/main/res/layout/content_flipviews.xml
@@ -246,7 +246,7 @@
app:frontBackground="@drawable/circle_light_stroke"
app:frontImage="@drawable/ic_lock_white_24dp"/>
-
-