diff --git a/README.md b/README.md index 5bd0028d..7690dfc3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # FlexibleAdapter -#### Version of 2015.07.03 -#### A pattern for every RecycleView +#### Version of 2015.07.20 +#### A pattern for every RecyclerView -The functionalities are taken from different blogs (see at the bottom of the page), merged and methods have been improved for speed and scalability, for all Activities that use a RecycleView. +The functionalities are taken from different Blogs (see at the bottom of the page), merged and methods have been improved for speed and scalability, for all Activities that use a RecycleView. * At lower class there is SelectableAdapter that provides selection functionalities and it's able to _maintain the state_ after the rotation, you just need to call the onSave/onRestore methods from the Activity! * Then, the class FlexibleAdapter handles the content paying attention at the animations (calling notify only for the position. _Note:_ you still need to set your animation to the RecyclerView when you create it in the Activity). @@ -12,15 +12,15 @@ I've put the click listeners inside the ViewHolder and the Set is done at the cr Also note that this adapter handles the basic clicks: _single_ and _long clicks_. If you need a double tap you need to implement the android.view.GestureDetector. -**Notes:** -There's an example adapter which does not compile because you need to change the classes with the ones you have in your project :-) - I still have to improve it, so keep an eye on it. -I would like to add some new functionalities, like the Undo (Time is always missing). +I would like to add some new functionalities, like the Undo. + +# Screenshots +![Main screen](/screenshots/main_screen.png) ![Multi Selection](/screenshots/multi_selection.png) #Setup Ultra simple: -No needs to create and import library for just 2 files, so just *copy* SelectableAdapter.java & FlexibleAdapter.java in your *common* package and start to *extend* FlexibleAdapter from your custom Adapter (see my example Adapter). +No needs to create and import library for just 2 files, so just *copy* SelectableAdapter.java & FlexibleAdapter.java in your *common* package and start to *extend* FlexibleAdapter from your custom Adapter (see my ExampleAdapter). ####Pull requests / Issues / Improvement requests Feel free to do and ask! @@ -42,8 +42,10 @@ In your activity change the Mode for the _ActionMode_ object. mActionMode = null; } - #Change Log +**2015.07.20** +- New full working example Android Studio project! (with some nice extra-features) + **2015.07.03** - Added new method _updateItem()_ - Deprecated _removeSelection()_ -> Use _toggleSelection()_ instead! @@ -62,7 +64,6 @@ In your activity change the Mode for the _ActionMode_ object. - Initial release #Thanks - I've used these blogs as starting point: http://enoent.fr/blog/2015/01/18/recyclerview-basics/ diff --git a/flexibleAdapter/build.gradle b/flexibleAdapter/build.gradle index 649b56df..0a1484b0 100644 --- a/flexibleAdapter/build.gradle +++ b/flexibleAdapter/build.gradle @@ -8,8 +8,8 @@ android { applicationId "eu.davidea.flexibleadapter" minSdkVersion 14 targetSdkVersion 22 - versionCode 1 - versionName "1.0" + versionCode 4 + versionName "2015.07.20" } buildTypes { release { diff --git a/flexibleAdapter/src/main/AndroidManifest.xml b/flexibleAdapter/src/main/AndroidManifest.xml index f1384bda..156a42a6 100644 --- a/flexibleAdapter/src/main/AndroidManifest.xml +++ b/flexibleAdapter/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ android:label="@string/app_name" android:theme="@style/AppTheme"> + android:name=".MainActivity"> diff --git a/flexibleAdapter/src/main/ic_launcher-web.png b/flexibleAdapter/src/main/ic_launcher-web.png index 363aa29d..becdf812 100644 Binary files a/flexibleAdapter/src/main/ic_launcher-web.png and b/flexibleAdapter/src/main/ic_launcher-web.png differ diff --git a/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java b/flexibleAdapter/src/main/java/eu/davidea/common/FlexibleAdapter.java similarity index 99% rename from flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java rename to flexibleAdapter/src/main/java/eu/davidea/common/FlexibleAdapter.java index 877cef01..0e4875c0 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/FlexibleAdapter.java +++ b/flexibleAdapter/src/main/java/eu/davidea/common/FlexibleAdapter.java @@ -1,4 +1,4 @@ -package eu.davidea.flexibleadapter; +package eu.davidea.common; import java.util.Collections; import java.util.Comparator; diff --git a/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/SelectableAdapter.java b/flexibleAdapter/src/main/java/eu/davidea/common/SelectableAdapter.java similarity index 99% rename from flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/SelectableAdapter.java rename to flexibleAdapter/src/main/java/eu/davidea/common/SelectableAdapter.java index a8894fc6..a2677a0f 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/SelectableAdapter.java +++ b/flexibleAdapter/src/main/java/eu/davidea/common/SelectableAdapter.java @@ -1,4 +1,4 @@ -package eu.davidea.flexibleadapter; +package eu.davidea.common; import java.util.ArrayList; import java.util.Iterator; diff --git a/flexibleAdapter/src/main/java/eu/davidea/example/SimpleDividerItemDecoration.java b/flexibleAdapter/src/main/java/eu/davidea/common/SimpleDividerItemDecoration.java similarity index 98% rename from flexibleAdapter/src/main/java/eu/davidea/example/SimpleDividerItemDecoration.java rename to flexibleAdapter/src/main/java/eu/davidea/common/SimpleDividerItemDecoration.java index ad03b019..36b3915a 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/example/SimpleDividerItemDecoration.java +++ b/flexibleAdapter/src/main/java/eu/davidea/common/SimpleDividerItemDecoration.java @@ -1,4 +1,4 @@ -package eu.davidea.example; +package eu.davidea.common; import android.content.Context; import android.content.res.TypedArray; diff --git a/flexibleAdapter/src/main/java/eu/davidea/common/SimpleTextWatcher.java b/flexibleAdapter/src/main/java/eu/davidea/common/SimpleTextWatcher.java new file mode 100644 index 00000000..3f330672 --- /dev/null +++ b/flexibleAdapter/src/main/java/eu/davidea/common/SimpleTextWatcher.java @@ -0,0 +1,26 @@ +package eu.davidea.common; + +import android.text.Editable; +import android.text.TextWatcher; + +/** + * {@link TextWatcher} implementation that does nothing by default + */ +public abstract class SimpleTextWatcher implements TextWatcher { + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + + } + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void afterTextChanged(Editable s) { + + } + +} \ No newline at end of file diff --git a/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/EditItemDialog.java b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/EditItemDialog.java new file mode 100644 index 00000000..750b0fd5 --- /dev/null +++ b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/EditItemDialog.java @@ -0,0 +1,173 @@ +package eu.davidea.flexibleadapter; + +import android.annotation.SuppressLint; +import android.app.DialogFragment; +import android.app.Fragment; +import android.content.DialogInterface; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.support.v7.app.AlertDialog; +import android.text.Editable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.EditText; + +import eu.davidea.common.SimpleTextWatcher; +import eu.davidea.utils.Utils; + + +public class EditItemDialog extends DialogFragment { + + public static final String TAG = EditItemDialog.class.getSimpleName(); + public static final String ARG_ITEM = "item"; + public static final String ARG_ITEM_POSITION = "position"; + + public interface OnEditItemListener { + void onTitleModified(int position, String newTitle); + } + + private Item mItem; + private int mPosition; + + public EditItemDialog() { + } + + public static EditItemDialog newInstance(Item item, int position) { + return newInstance(item, position, null); + } + + public static EditItemDialog newInstance(Item item, int position, Fragment fragment) { + EditItemDialog dialog = new EditItemDialog(); + Bundle args = new Bundle(); + args.putSerializable(ARG_ITEM, item); + args.putInt(ARG_ITEM_POSITION, position); + dialog.setArguments(args); + dialog.setArguments(args); + dialog.setTargetFragment(fragment, 0); + return dialog; + } + + private OnEditItemListener getListener() { + OnEditItemListener listener = (OnEditItemListener) getTargetFragment(); + if (listener == null) { + listener = (OnEditItemListener) getActivity(); + } + return listener; + } + + @Override + public void onSaveInstanceState(Bundle outState) { + outState.putSerializable(ARG_ITEM, mItem); + super.onSaveInstanceState(outState); + } + + @Override + public void onStart() { + super.onStart(); + getDialog().getWindow().setWindowAnimations(R.style.animation_slide_from_right); + } + + @SuppressLint({"InflateParams", "HandlerLeak"}) + @Override + public AlertDialog onCreateDialog(Bundle savedInstanceState) { + //Pick up bundle parameters + Bundle bundle; + if (savedInstanceState == null) { + bundle = getArguments(); + } else { + bundle = savedInstanceState; + } + + mItem = (Item) bundle.getSerializable(ARG_ITEM); + mPosition = bundle.getInt(ARG_ITEM_POSITION); + + //Inflate custom view + View dialogView = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_edit_item, null); + + final EditText editText = (EditText) dialogView.findViewById(R.id.text_edit_title); + + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());//, R.style.AppTheme_AlertDialog); + builder.setTitle(R.string.dialog_edit_title) + .setView(dialogView) + .setNegativeButton(R.string.CANCEL, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Utils.hideSoftInputFrom(getActivity(), editText); + dialog.dismiss(); + } + }) + .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + getListener().onTitleModified(mPosition, + editText.getText().toString().trim()); + Utils.hideSoftInputFrom(getActivity(), editText); + dialog.dismiss(); + } + }); + + final AlertDialog editDialog = builder.create(); + + editDialog.setOnShowListener(new DialogInterface.OnShowListener() { + @Override + public void onShow(DialogInterface dialog) { + updateOkButtonState(editDialog, null); + } + }); + + if (mItem != null) { + editText.setText(mItem.getTitle()); + editText.selectAll(); + } + editText.requestFocus(); + editText.addTextChangedListener(new SimpleTextWatcher() { + private final static long DELAY = 400L; + private final static int TRIGGER = 1; + + private Handler mHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + if (msg.what == TRIGGER) { + updateOkButtonState(editDialog, editText); + } + } + }; + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + updateOkButtonState(editDialog, null); + } + + @Override + public void afterTextChanged(Editable s) { + mHandler.removeMessages(TRIGGER); + mHandler.sendEmptyMessageDelayed(TRIGGER, DELAY); + } + }); + + editDialog.getWindow().setSoftInputMode( + WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); + + return editDialog; + } + + private void updateOkButtonState(AlertDialog dialog, EditText editText) { + Button buttonOK = dialog.getButton(DialogInterface.BUTTON_POSITIVE); + if (editText == null || (editText.getText().toString().trim()).length() == 0) { + buttonOK.setEnabled(false); + return; + } + if (mItem != null && !mItem.getTitle().equalsIgnoreCase(editText.getText().toString().trim())) { + buttonOK.setEnabled(true); + } else { + editText.setError(getActivity().getString(R.string.err_no_edit)); + buttonOK.setEnabled(false); + } + + return; + } + +} \ No newline at end of file diff --git a/flexibleAdapter/src/main/java/eu/davidea/example/ExampleAdapter.java b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/ExampleAdapter.java similarity index 95% rename from flexibleAdapter/src/main/java/eu/davidea/example/ExampleAdapter.java rename to flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/ExampleAdapter.java index 76128ce4..e7fd37a6 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/example/ExampleAdapter.java +++ b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/ExampleAdapter.java @@ -1,4 +1,4 @@ -package eu.davidea.example; +package eu.davidea.flexibleadapter; import android.content.Context; import android.support.v7.widget.RecyclerView; @@ -13,8 +13,7 @@ import java.util.ArrayList; import java.util.List; -import eu.davidea.flexibleadapter.FlexibleAdapter; -import eu.davidea.flexibleadapter.R; +import eu.davidea.common.FlexibleAdapter; public class ExampleAdapter extends FlexibleAdapter { @@ -157,13 +156,13 @@ public void run() { } else { //Display the current flip status //setFlipped(holder.mImageView, isSelected(position)); + } - //This "if-else" is just an example - if (isSelected(position)) { - holder.mImageView.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.image_round_selected)); - } else { - holder.mImageView.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.image_round_normal)); - } + //This "if-else" is just an example + if (isSelected(position)) { + holder.mImageView.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.image_round_selected)); + } else { + holder.mImageView.setBackgroundDrawable(mContext.getResources().getDrawable(R.drawable.image_round_normal)); } holder.mTitle.setText(item.getTitle()); diff --git a/flexibleAdapter/src/main/java/eu/davidea/example/Item.java b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/Item.java similarity index 76% rename from flexibleAdapter/src/main/java/eu/davidea/example/Item.java rename to flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/Item.java index f6849759..97d0b127 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/example/Item.java +++ b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/Item.java @@ -1,6 +1,11 @@ -package eu.davidea.example; +package eu.davidea.flexibleadapter; + +import java.io.Serializable; + +public class Item implements Serializable { + + private static final long serialVersionUID = -6882745111884490060L; -public class Item { private int id; private String title; private String subtitle; diff --git a/flexibleAdapter/src/main/java/eu/davidea/example/MainActivity.java b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/MainActivity.java similarity index 88% rename from flexibleAdapter/src/main/java/eu/davidea/example/MainActivity.java rename to flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/MainActivity.java index 0ce0e016..414c7c64 100644 --- a/flexibleAdapter/src/main/java/eu/davidea/example/MainActivity.java +++ b/flexibleAdapter/src/main/java/eu/davidea/flexibleadapter/MainActivity.java @@ -1,4 +1,4 @@ -package eu.davidea.example; +package eu.davidea.flexibleadapter; import android.annotation.TargetApi; import android.os.Build; @@ -14,14 +14,15 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.AdapterView; import android.widget.TextView; import android.widget.Toast; -import eu.davidea.flexibleadapter.R; +import eu.davidea.common.SimpleDividerItemDecoration; import eu.davidea.utils.Utils; public class MainActivity extends AppCompatActivity implements - ActionMode.Callback, + ActionMode.Callback, EditItemDialog.OnEditItemListener, ExampleAdapter.OnItemClickListener { public static final String TAG = MainActivity.class.getSimpleName(); @@ -71,21 +72,26 @@ protected void onCreate(Bundle savedInstanceState) { mFab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + destroyActionModeIfNeeded(); + Item item = null; for (int i = 0; i= VERSION_CODES.LOLLIPOP; } + public static String getVersionName(Context context) { + try { + PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); + return "v"+pInfo.versionName; + } catch (PackageManager.NameNotFoundException e) { + return context.getString(android.R.string.unknownName); + } + } + + public static int getVersionCode(Context context) { + try { + PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); + return pInfo.versionCode; + } catch (PackageManager.NameNotFoundException e) { + return 0; + } + } + + /** + * Show Soft Keyboard with new Thread + * @param activity + */ + public static void hideSoftInput(final Activity activity) { + if (activity.getCurrentFocus() != null) { + new Runnable() { + public void run() { + InputMethodManager imm = + (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0); + } + }.run(); + } + } + + /** + * Hide Soft Keyboard from Dialogs with new Thread + * @param context + * @param view + */ + public static void hideSoftInputFrom(final Context context, final View view) { + new Runnable() { + @Override + public void run() { + InputMethodManager imm = + (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(view.getWindowToken(), 0); + } + }.run(); + } + + /** + * Show Soft Keyboard with new Thread + * @param context + * @param view + */ + public static void showSoftInput(final Context context, final View view) { + new Runnable() { + @Override + public void run() { + InputMethodManager imm = + (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); + } + }.run(); + } + /** * Create the reveal effect animation * @param view the View to reveal diff --git a/flexibleAdapter/src/main/res/anim/fab_slide_in_from_left.xml b/flexibleAdapter/src/main/res/anim/fab_slide_in_from_left.xml new file mode 100644 index 00000000..de953c70 --- /dev/null +++ b/flexibleAdapter/src/main/res/anim/fab_slide_in_from_left.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/anim/fab_slide_in_from_right.xml b/flexibleAdapter/src/main/res/anim/fab_slide_in_from_right.xml new file mode 100644 index 00000000..05c271f4 --- /dev/null +++ b/flexibleAdapter/src/main/res/anim/fab_slide_in_from_right.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/anim/fab_slide_out_to_left.xml b/flexibleAdapter/src/main/res/anim/fab_slide_out_to_left.xml new file mode 100644 index 00000000..33f60b48 --- /dev/null +++ b/flexibleAdapter/src/main/res/anim/fab_slide_out_to_left.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/anim/fab_slide_out_to_right.xml b/flexibleAdapter/src/main/res/anim/fab_slide_out_to_right.xml new file mode 100644 index 00000000..78c0d614 --- /dev/null +++ b/flexibleAdapter/src/main/res/anim/fab_slide_out_to_right.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/drawable-hdpi/ic_info_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-hdpi/ic_info_grey600_24dp.png new file mode 100644 index 00000000..713a9ba9 Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-hdpi/ic_info_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-mdpi/ic_expand_more_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-mdpi/ic_expand_more_grey600_24dp.png new file mode 100644 index 00000000..c6d6c962 Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-mdpi/ic_expand_more_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-mdpi/ic_info_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-mdpi/ic_info_grey600_24dp.png new file mode 100644 index 00000000..2537c5f4 Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-mdpi/ic_info_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-v21/button_mini_oval.xml b/flexibleAdapter/src/main/res/drawable-v21/button_mini_oval.xml index d88fe966..9d7fdd75 100644 --- a/flexibleAdapter/src/main/res/drawable-v21/button_mini_oval.xml +++ b/flexibleAdapter/src/main/res/drawable-v21/button_mini_oval.xml @@ -1,7 +1,7 @@ + android:color="@android:color/white"> diff --git a/flexibleAdapter/src/main/res/drawable-v21/selector_item_light.xml b/flexibleAdapter/src/main/res/drawable-v21/selector_item_light.xml index bbe0b902..b84ac1ab 100644 --- a/flexibleAdapter/src/main/res/drawable-v21/selector_item_light.xml +++ b/flexibleAdapter/src/main/res/drawable-v21/selector_item_light.xml @@ -1,9 +1,14 @@ - + android:exitFadeDuration="@android:integer/config_shortAnimTime" + android:color="?android:attr/colorControlHighlight"> + - + android:drawable="@color/list_choice_pressed_bg_light" /> + + + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/drawable-xhdpi/ic_info_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-xhdpi/ic_info_grey600_24dp.png new file mode 100644 index 00000000..9dcb234f Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-xhdpi/ic_info_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-xxhdpi/ic_info_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-xxhdpi/ic_info_grey600_24dp.png new file mode 100644 index 00000000..64445284 Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-xxhdpi/ic_info_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-xxxhdpi/ic_info_grey600_24dp.png b/flexibleAdapter/src/main/res/drawable-xxxhdpi/ic_info_grey600_24dp.png new file mode 100644 index 00000000..17abca45 Binary files /dev/null and b/flexibleAdapter/src/main/res/drawable-xxxhdpi/ic_info_grey600_24dp.png differ diff --git a/flexibleAdapter/src/main/res/drawable-xhdpi/button_mini_oval.xml b/flexibleAdapter/src/main/res/drawable/button_mini_oval.xml similarity index 100% rename from flexibleAdapter/src/main/res/drawable-xhdpi/button_mini_oval.xml rename to flexibleAdapter/src/main/res/drawable/button_mini_oval.xml diff --git a/flexibleAdapter/src/main/res/layout/activity_main.xml b/flexibleAdapter/src/main/res/layout/activity_main.xml index 9aea233a..3d7d6d30 100644 --- a/flexibleAdapter/src/main/res/layout/activity_main.xml +++ b/flexibleAdapter/src/main/res/layout/activity_main.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context="eu.davidea.example.MainActivity"> + tools:context="eu.davidea.flexibleadapter.example.MainActivity"> + + + + + + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/layout/dialog_message.xml b/flexibleAdapter/src/main/res/layout/dialog_message.xml new file mode 100644 index 00000000..b794b8d9 --- /dev/null +++ b/flexibleAdapter/src/main/res/layout/dialog_message.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/layout/recycler_uls_row.xml b/flexibleAdapter/src/main/res/layout/recycler_uls_row.xml index 7cba0f8c..3bd732df 100644 --- a/flexibleAdapter/src/main/res/layout/recycler_uls_row.xml +++ b/flexibleAdapter/src/main/res/layout/recycler_uls_row.xml @@ -30,8 +30,8 @@ android:layout_alignParentRight="true" android:layout_alignParentEnd="true" android:layout_centerInParent="true" - android:layout_marginRight="@dimen/margin_right" - android:layout_marginEnd="@dimen/margin_right"> + android:layout_marginRight="@dimen/margin_right_small" + android:layout_marginEnd="@dimen/margin_right_small"> + tools:context="eu.davidea.flexibleadapter.example.MainActivity"> 16dp 16dp 16dp + 8dp 40dp 40dp - 32dp + 40dp 16dp + + 24dp + 24dp diff --git a/flexibleAdapter/src/main/res/values/strings.xml b/flexibleAdapter/src/main/res/values/strings.xml index 652eaa29..529cf155 100644 --- a/flexibleAdapter/src/main/res/values/strings.xml +++ b/flexibleAdapter/src/main/res/values/strings.xml @@ -8,7 +8,40 @@ deleted - Click on Image [or LongClick on Item] to select that Item]]> - This is an example of 2nd view]]> + Click on Image (or LongClick on Item) to select that Item]]> + This is an example of 2nd view type]]> No items - + Title + Edit title + Cancel + OK + Nothing to modify + + + About + Flexible Adapter
+%1$s + +

Author
+Davide Steduto on G+ + +

Contact
+Github Profile + +

Licence
+Copyright © 2015 Davide Steduto. +

Licensed under the Apache License, Version 2.0 (the "License"); +You may not use this file except in compliance with the License. +You may obtain a copy of the License at + +

http://www.apache.org/licenses/LICENSE-2.0 + +

Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +
See the License for the specific language governing permissions and +limitations under the License. +]]>
+ + \ No newline at end of file diff --git a/flexibleAdapter/src/main/res/values/styles.xml b/flexibleAdapter/src/main/res/values/styles.xml index 13ea8134..04a3577a 100644 --- a/flexibleAdapter/src/main/res/values/styles.xml +++ b/flexibleAdapter/src/main/res/values/styles.xml @@ -17,4 +17,17 @@ @drawable/primary_text_selector_light + + + + \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..8c0fb64a Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..02c998cf --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Jul 20 18:19:31 CEST 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip diff --git a/screenshots/main_screen.png b/screenshots/main_screen.png new file mode 100644 index 00000000..90beb02b Binary files /dev/null and b/screenshots/main_screen.png differ diff --git a/screenshots/multi_selection.png b/screenshots/multi_selection.png new file mode 100644 index 00000000..05da67b6 Binary files /dev/null and b/screenshots/multi_selection.png differ