Added swipe func to the item details frag
This commit is contained in:
parent
a89d5ee1bc
commit
692dd90ca8
|
@ -37,7 +37,7 @@
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
<ConfirmationsSetting value="0" id="Add" />
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
<ConfirmationsSetting value="0" id="Remove" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.view.MenuItem;
|
||||||
import com.hikapro.backpack.model.AddModel;
|
import com.hikapro.backpack.model.AddModel;
|
||||||
import com.hikapro.backpack.model.DetailModel;
|
import com.hikapro.backpack.model.DetailModel;
|
||||||
import com.hikapro.backpack.model.ItemModel;
|
import com.hikapro.backpack.model.ItemModel;
|
||||||
|
import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.PackedModel;
|
import com.hikapro.backpack.model.PackedModel;
|
||||||
import com.hikapro.backpack.model.SetModel;
|
import com.hikapro.backpack.model.SetModel;
|
||||||
import com.hikapro.backpack.model.ShareModel;
|
import com.hikapro.backpack.model.ShareModel;
|
||||||
|
@ -244,10 +245,10 @@ public class MainActivity extends Activity implements View.ActivityCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startItemDetailFragment(Item item, int setId) {
|
public void startItemDetailFragment(int setId, Model.Item baseModel, int position) {
|
||||||
|
|
||||||
ItemDetailFragment view = ItemDetailFragment.newInstance(item, setId);
|
ItemDetailFragment view = ItemDetailFragment.newInstance(setId);
|
||||||
ItemDetailPresenter presenter = new ItemDetailPresenter();
|
ItemDetailPresenter presenter = new ItemDetailPresenter(baseModel, position);
|
||||||
DetailModel model = new DetailModel();
|
DetailModel model = new DetailModel();
|
||||||
|
|
||||||
view.setPresenter(presenter);
|
view.setPresenter(presenter);
|
||||||
|
@ -260,6 +261,7 @@ public class MainActivity extends Activity implements View.ActivityCallback {
|
||||||
|
|
||||||
stateMaintainer.put(presenter);
|
stateMaintainer.put(presenter);
|
||||||
stateMaintainer.put(model);
|
stateMaintainer.put(model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -34,11 +34,17 @@ public class DetailModel implements Model.Detail {
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item findItem(int id) {
|
public Item getCurrentItem() {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCurrentItem(Item item) {
|
||||||
|
this.item = item;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Bitmap getPicture() {
|
public Bitmap getPicture() {
|
||||||
return pic;
|
return pic;
|
||||||
|
@ -129,7 +135,6 @@ public class DetailModel implements Model.Detail {
|
||||||
@Override
|
@Override
|
||||||
public void setPresenter(Presenter.ItemDetail presenter) {
|
public void setPresenter(Presenter.ItemDetail presenter) {
|
||||||
this.presenter = presenter;
|
this.presenter = presenter;
|
||||||
this.item = presenter.getCurrentItem();
|
|
||||||
this.currentSet = presenter.getSetId();
|
this.currentSet = presenter.getSetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,8 @@ public interface Model {
|
||||||
|
|
||||||
interface Detail extends Base {
|
interface Detail extends Base {
|
||||||
int getCount();
|
int getCount();
|
||||||
com.hikapro.backpack.model.entities.Item findItem(int id);
|
com.hikapro.backpack.model.entities.Item getCurrentItem();
|
||||||
|
void setCurrentItem(com.hikapro.backpack.model.entities.Item item);
|
||||||
Bitmap getPicture();
|
Bitmap getPicture();
|
||||||
void setPresenter(Presenter.ItemDetail presenter);
|
void setPresenter(Presenter.ItemDetail presenter);
|
||||||
Presenter.ItemDetail getPresenter();
|
Presenter.ItemDetail getPresenter();
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -1628,6 +1629,7 @@ public class DAO {
|
||||||
String filename = null;
|
String filename = null;
|
||||||
|
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
|
if (!TextUtils.isEmpty(item.getPhotoLocal()))
|
||||||
bitmap = BitmapFactory.decodeFile(item.getPhotoLocal());
|
bitmap = BitmapFactory.decodeFile(item.getPhotoLocal());
|
||||||
// cannot retrieve, download and save then
|
// cannot retrieve, download and save then
|
||||||
if (bitmap == null) { // return it
|
if (bitmap == null) { // return it
|
||||||
|
|
|
@ -5,11 +5,13 @@ import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
|
||||||
|
@ -20,7 +22,8 @@ import com.hikapro.backpack.App;
|
||||||
*/
|
*/
|
||||||
public class ImageDownloadHelper {
|
public class ImageDownloadHelper {
|
||||||
|
|
||||||
public static final String ITEMS_TAG = "items";
|
public static final String IMAGE_DOWNLOAD_TAG = "Image download";
|
||||||
|
public static final String IMAGE_DIRECTORY_NAME = "items";
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
public ImageDownloadHelper() {
|
public ImageDownloadHelper() {
|
||||||
|
@ -32,10 +35,15 @@ public class ImageDownloadHelper {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(netPath);
|
URL url = new URL(netPath);
|
||||||
URLConnection conn = url.openConnection();
|
URLConnection conn = url.openConnection();
|
||||||
|
conn.setReadTimeout(4000);
|
||||||
bitmap = BitmapFactory.decodeStream(conn.getInputStream());
|
bitmap = BitmapFactory.decodeStream(conn.getInputStream());
|
||||||
|
} catch (SocketTimeoutException ex) {
|
||||||
|
bitmap = null;
|
||||||
|
Log.e(IMAGE_DOWNLOAD_TAG, " Timeout elapsed.");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.e(ITEMS_TAG, " File cannot be downloaded");
|
Log.e(IMAGE_DOWNLOAD_TAG, " File cannot be downloaded due to exception.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +70,9 @@ public class ImageDownloadHelper {
|
||||||
try {
|
try {
|
||||||
file = File.createTempFile(fileName, null, context.getCacheDir());
|
file = File.createTempFile(fileName, null, context.getCacheDir());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(ITEMS_TAG, " Cannot obtain temp file");
|
Log.e(IMAGE_DOWNLOAD_TAG, " Cannot obtain temp file");
|
||||||
}
|
}
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,17 +86,25 @@ public class ImageDownloadHelper {
|
||||||
|
|
||||||
public String saveImageInternal(String filename, Bitmap bitmap) {
|
public String saveImageInternal(String filename, Bitmap bitmap) {
|
||||||
File file = null;
|
File file = null;
|
||||||
FileOutputStream outputStream;
|
FileOutputStream outputStream = null;
|
||||||
if (bitmap != null && !filename.isEmpty()) {
|
if (bitmap != null && !filename.isEmpty()) {
|
||||||
file = createTempFile(filename);
|
file = createTempFile(filename);
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
try {
|
try {
|
||||||
outputStream = new FileOutputStream(file);
|
outputStream = new FileOutputStream(file);
|
||||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (Internal): " + e);
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
if (outputStream != null) {
|
||||||
|
try {
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
Log.e(ITEMS_TAG, " File cannot be saved");
|
// do nothing here
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,18 +113,32 @@ public class ImageDownloadHelper {
|
||||||
|
|
||||||
public String saveImageExternal(String filename, Bitmap bitmap) {
|
public String saveImageExternal(String filename, Bitmap bitmap) {
|
||||||
File file = null;
|
File file = null;
|
||||||
FileOutputStream outputStream;
|
FileOutputStream outputStream = null;
|
||||||
if (isExternalStorageWritable()) {
|
if (isExternalStorageWritable()) {
|
||||||
if (bitmap != null && !filename.isEmpty()) {
|
if (bitmap != null && !filename.isEmpty()) {
|
||||||
File directory = getDir();
|
|
||||||
file = new File(directory.getAbsoluteFile(), filename);
|
|
||||||
try {
|
try {
|
||||||
|
File directory = getDir();
|
||||||
|
if (directory != null) {
|
||||||
|
file = new File(directory.getAbsoluteFile(), filename);
|
||||||
outputStream = new FileOutputStream(file);
|
outputStream = new FileOutputStream(file);
|
||||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
|
||||||
|
} else {
|
||||||
|
Log.e(IMAGE_DOWNLOAD_TAG, "Saving failed (External): directory unavailable.");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(IMAGE_DOWNLOAD_TAG, "File cannot be saved (External): " + e);
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
|
||||||
|
if (outputStream != null) {
|
||||||
|
try {
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e(ITEMS_TAG, " File cannot be saved");
|
} catch (IOException e) {
|
||||||
|
// do nothing here
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,30 +147,47 @@ public class ImageDownloadHelper {
|
||||||
|
|
||||||
/* Checks if external storage is available for read and write */
|
/* Checks if external storage is available for read and write */
|
||||||
public boolean isExternalStorageWritable() {
|
public boolean isExternalStorageWritable() {
|
||||||
|
boolean ret;
|
||||||
String state = Environment.getExternalStorageState();
|
String state = Environment.getExternalStorageState();
|
||||||
if (Environment.MEDIA_MOUNTED.equals(state)) {
|
if (Environment.MEDIA_MOUNTED.equals(state)) {
|
||||||
return true;
|
ret = true;
|
||||||
}
|
} else
|
||||||
return false;
|
ret = false;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Checks if external storage is available to at least read */
|
/* Checks if external storage is available to at least read */
|
||||||
public boolean isExternalStorageReadable() {
|
public boolean isExternalStorageReadable() {
|
||||||
|
boolean ret;
|
||||||
String state = Environment.getExternalStorageState();
|
String state = Environment.getExternalStorageState();
|
||||||
if (Environment.MEDIA_MOUNTED.equals(state) ||
|
if (Environment.MEDIA_MOUNTED.equals(state) ||
|
||||||
Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
|
Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
|
||||||
return true;
|
ret = true;
|
||||||
}
|
} else
|
||||||
return false;
|
ret = false;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
private File getDir() {
|
private File getDir() {
|
||||||
// Get the directory for the app's private pictures directory.
|
File ret = null;
|
||||||
File file = new File(context.getExternalFilesDir(
|
// Get available SD cards
|
||||||
Environment.DIRECTORY_PICTURES), ITEMS_TAG);
|
File[] dirs = ContextCompat.getExternalFilesDirs(context, Environment.DIRECTORY_PICTURES);
|
||||||
if (!file.mkdirs()) {
|
if (dirs != null) {
|
||||||
Log.e(ITEMS_TAG, " Directory not created");
|
switch (dirs.length) {
|
||||||
}
|
case 1:
|
||||||
return file;
|
ret = new File(dirs[0], IMAGE_DIRECTORY_NAME); // can be emulated SD card
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ret = new File(dirs[1], IMAGE_DIRECTORY_NAME);// real SD card
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ret.mkdirs()) {
|
||||||
|
Log.e(IMAGE_DOWNLOAD_TAG, "Directory was not created or already exists.");
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,10 @@ import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.entities.Category;
|
import com.hikapro.backpack.model.entities.Category;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
import com.hikapro.backpack.presenter.adapters.AddListAdapter;
|
import com.hikapro.backpack.presenter.adapters.AddListAdapter;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.FlowLayout;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.Util;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
|
||||||
import com.hikapro.backpack.view.View;
|
import com.hikapro.backpack.view.View;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
@ -43,7 +46,7 @@ public class AddPresenter implements Presenter.Add {
|
||||||
|
|
||||||
private AddListAdapter adapter;
|
private AddListAdapter adapter;
|
||||||
private RecyclerView recycler;
|
private RecyclerView recycler;
|
||||||
private ViewGroup categoryContainer;
|
private FlowLayout categoryContainer;
|
||||||
private ViewGroup categoryContainerMain;
|
private ViewGroup categoryContainerMain;
|
||||||
private boolean isContainerAlreadyInitialised;
|
private boolean isContainerAlreadyInitialised;
|
||||||
private Item newItem;
|
private Item newItem;
|
||||||
|
@ -94,8 +97,10 @@ public class AddPresenter implements Presenter.Add {
|
||||||
recycler.setLayoutManager(llm);
|
recycler.setLayoutManager(llm);
|
||||||
recycler.setAdapter(adapter);
|
recycler.setAdapter(adapter);
|
||||||
recycler.setItemAnimator(new DefaultItemAnimator());
|
recycler.setItemAnimator(new DefaultItemAnimator());
|
||||||
recycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
//recycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
||||||
categoryContainer = (ViewGroup) view.findViewById(R.id.add_item_category_flow);
|
recycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider, Util.dp2px(getAppContext(), 16)));
|
||||||
|
categoryContainer = (FlowLayout) view.findViewById(R.id.add_item_category_flow);
|
||||||
|
//categoryContainer.setPaddings(Util.dp2px(getAppContext(), 15), Util.dp2px(getAppContext(), 15)); // TODO check here
|
||||||
categoryContainerMain = (ViewGroup) view.findViewById(R.id.add_item_category_container);
|
categoryContainerMain = (ViewGroup) view.findViewById(R.id.add_item_category_container);
|
||||||
categoryContainerMain.setVisibility(android.view.View.GONE);
|
categoryContainerMain.setVisibility(android.view.View.GONE);
|
||||||
recycler.setVisibility(android.view.View.GONE);
|
recycler.setVisibility(android.view.View.GONE);
|
||||||
|
@ -222,7 +227,9 @@ public class AddPresenter implements Presenter.Add {
|
||||||
button = (Button) LayoutInflater.from(getActivityContext()).inflate(
|
button = (Button) LayoutInflater.from(getActivityContext()).inflate(
|
||||||
R.layout.category_button, null);
|
R.layout.category_button, null);
|
||||||
button.setId(category.getId());
|
button.setId(category.getId());
|
||||||
button.setText(category.getName());
|
String txt = category.getName();
|
||||||
|
|
||||||
|
button.setText(txt);
|
||||||
button.setOnClickListener(new CategoryButtonClickListener());
|
button.setOnClickListener(new CategoryButtonClickListener());
|
||||||
categoryContainer.addView(button);
|
categoryContainer.addView(button);
|
||||||
|
|
||||||
|
|
|
@ -4,18 +4,17 @@ import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.DefaultItemAnimator;
|
import android.support.v7.widget.DefaultItemAnimator;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.webkit.URLUtil;
|
import android.webkit.URLUtil;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
@ -23,7 +22,10 @@ import com.hikapro.backpack.R;
|
||||||
import com.hikapro.backpack.model.Model;
|
import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
import com.hikapro.backpack.presenter.adapters.ItemDetailAdapter;
|
import com.hikapro.backpack.presenter.adapters.ItemDetailAdapter;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.OnSwipeTouchListener;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.Util;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
|
||||||
import com.hikapro.backpack.view.View;
|
import com.hikapro.backpack.view.View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,19 +35,23 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
|
|
||||||
private WeakReference<View.ItemDetail> view;
|
private WeakReference<View.ItemDetail> view;
|
||||||
private Model.Detail model;
|
private Model.Detail model;
|
||||||
|
private Model.Item exModel;
|
||||||
private ItemDetailAdapter adapter;
|
private ItemDetailAdapter adapter;
|
||||||
private Item item;
|
private Item item;
|
||||||
private int setId;
|
private int setId;
|
||||||
private ImageView itemPhoto;
|
private ImageView itemPhoto;
|
||||||
private TextView itemDescription;
|
private TextView itemDescription;
|
||||||
private TextView itemLink;
|
private TextView itemLink;
|
||||||
|
private int position;
|
||||||
|
private ViewGroup progress;
|
||||||
|
private OnSwipeTouchListener swipeTouchListener;
|
||||||
|
|
||||||
public ItemDetailPresenter() {
|
public ItemDetailPresenter(Model.Item itemModel, int startPosition) {
|
||||||
this.adapter = new ItemDetailAdapter(this);
|
this.adapter = new ItemDetailAdapter(this);
|
||||||
|
this.exModel = itemModel;
|
||||||
|
this.position = startPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// life cycle -->
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy(boolean isChangingConfiguration) {
|
public void onDestroy(boolean isChangingConfiguration) {
|
||||||
view = null;
|
view = null;
|
||||||
|
@ -54,6 +60,7 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
model = null;
|
model = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public android.view.View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public android.view.View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
@ -62,14 +69,32 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
itemPhoto = (ImageView) view.findViewById(R.id.item_photo);
|
itemPhoto = (ImageView) view.findViewById(R.id.item_photo);
|
||||||
itemDescription = (TextView) view.findViewById(R.id.item_description);
|
itemDescription = (TextView) view.findViewById(R.id.item_description);
|
||||||
itemLink = (TextView) view.findViewById(R.id.item_link);
|
itemLink = (TextView) view.findViewById(R.id.item_link);
|
||||||
|
progress = (ViewGroup) view.findViewById(R.id.detail_progress_container);
|
||||||
|
progress.setVisibility(android.view.View.VISIBLE);
|
||||||
|
swipeTouchListener = new OnSwipeTouchListener(getActivityContext()) {
|
||||||
|
@Override
|
||||||
|
public void onSwipeLeft() {
|
||||||
|
swipeLeft();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSwipeRight() {
|
||||||
|
swipeRight();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
progress.setOnTouchListener(swipeTouchListener);
|
||||||
|
itemDescription.setOnTouchListener(swipeTouchListener);
|
||||||
|
|
||||||
LinearLayoutManager llm = new LinearLayoutManager(getActivityContext());
|
LinearLayoutManager llm = new LinearLayoutManager(getActivityContext());
|
||||||
RecyclerView detailRecycler = (RecyclerView) view.findViewById(R.id.item_detail_recycler);
|
RecyclerView detailRecycler = (RecyclerView) view.findViewById(R.id.item_detail_recycler);
|
||||||
detailRecycler.setLayoutManager(llm);
|
detailRecycler.setLayoutManager(llm);
|
||||||
detailRecycler.setAdapter(adapter);
|
detailRecycler.setAdapter(adapter);
|
||||||
detailRecycler.setItemAnimator(new DefaultItemAnimator());
|
detailRecycler.setItemAnimator(new DefaultItemAnimator());
|
||||||
detailRecycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
//detailRecycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
||||||
|
detailRecycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider, Util.dp2px(getAppContext(), 16)));
|
||||||
|
|
||||||
detailRecycler.setHasFixedSize(true);
|
detailRecycler.setHasFixedSize(true);
|
||||||
|
model.setCurrentItem(exModel.getItemByPosition(position));
|
||||||
model.executeQuery();
|
model.executeQuery();
|
||||||
|
|
||||||
Activity activity = (Activity) getActivityContext();
|
Activity activity = (Activity) getActivityContext();
|
||||||
|
@ -87,19 +112,24 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
|
|
||||||
}
|
}
|
||||||
// life cycle <--
|
|
||||||
|
|
||||||
// process -->
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyDataSetChanged() {
|
public void notifyDataSetChanged() {
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
item = model.findItem(0);
|
item = model.getCurrentItem();
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(item.getDescription())) {
|
||||||
itemDescription.setText(item.getDescription());
|
itemDescription.setText(item.getDescription());
|
||||||
|
itemDescription.setVisibility(android.view.View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
itemDescription.setVisibility(android.view.View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
if (item.getBuyUrls() != null && !item.getBuyUrls().isEmpty()) {
|
if (item.getBuyUrls() != null && !item.getBuyUrls().isEmpty()) {
|
||||||
itemLink.setVisibility(android.view.View.VISIBLE);
|
itemLink.setVisibility(android.view.View.VISIBLE);
|
||||||
itemLink.setOnClickListener(new android.view.View.OnClickListener() {
|
itemLink.setOnClickListener(new android.view.View.OnClickListener() {
|
||||||
|
@ -122,16 +152,12 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// process <--
|
|
||||||
|
|
||||||
// other impl -->
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setView(View.ItemDetail view) {
|
public void setView(View.ItemDetail view) {
|
||||||
this.view = new WeakReference<>(view);
|
this.view = new WeakReference<>(view);
|
||||||
this.item = getView().getItem();
|
|
||||||
this.setId = view.getSetId();
|
this.setId = view.getSetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setModel(Model.Detail model) {
|
public void setModel(Model.Detail model) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
|
@ -166,9 +192,17 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void notifyPictureChanged() {
|
public void notifyPictureChanged() {
|
||||||
|
progress.setVisibility(android.view.View.GONE);
|
||||||
|
if (model.getPicture() != null) {
|
||||||
itemPhoto.setImageBitmap(model.getPicture());
|
itemPhoto.setImageBitmap(model.getPicture());
|
||||||
|
itemPhoto.setVisibility(android.view.View.VISIBLE);
|
||||||
|
itemPhoto.setOnTouchListener(swipeTouchListener);
|
||||||
|
} else {
|
||||||
|
itemPhoto.setImageBitmap(null);
|
||||||
|
itemPhoto.setVisibility(android.view.View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// other impl <--
|
|
||||||
|
|
||||||
private View.ItemDetail getView() throws NullPointerException {
|
private View.ItemDetail getView() throws NullPointerException {
|
||||||
if ( view != null )
|
if ( view != null )
|
||||||
|
@ -180,4 +214,34 @@ public class ItemDetailPresenter implements Presenter.ItemDetail {
|
||||||
public int getSetId() {
|
public int getSetId() {
|
||||||
return setId;
|
return setId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isValidPosition(int position) {
|
||||||
|
boolean ret;
|
||||||
|
ret = position > -1 && position < exModel.getItemsCount();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void swipeLeft() {
|
||||||
|
if (isValidPosition(position + 1)) {
|
||||||
|
// start progress
|
||||||
|
progress.setVisibility(android.view.View.VISIBLE);
|
||||||
|
itemPhoto.setVisibility(android.view.View.GONE);
|
||||||
|
// load data
|
||||||
|
model.setCurrentItem(exModel.getItemByPosition(++position));
|
||||||
|
model.executeQuery();
|
||||||
|
itemPhoto.setImageBitmap(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void swipeRight() {
|
||||||
|
if (isValidPosition(position - 1)) {
|
||||||
|
// start progress
|
||||||
|
progress.setVisibility(android.view.View.VISIBLE);
|
||||||
|
itemPhoto.setVisibility(android.view.View.GONE);
|
||||||
|
// load data
|
||||||
|
model.setCurrentItem(exModel.getItemByPosition(--position));
|
||||||
|
model.executeQuery();
|
||||||
|
itemPhoto.setImageBitmap(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,8 +21,10 @@ import com.hikapro.backpack.R;
|
||||||
import com.hikapro.backpack.model.Model;
|
import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
import com.hikapro.backpack.model.entities.Set;
|
import com.hikapro.backpack.model.entities.Set;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.Util;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration;
|
||||||
import com.hikapro.backpack.presenter.adapters.ItemListAdapter;
|
import com.hikapro.backpack.presenter.adapters.ItemListAdapter;
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.items.DividerDecoration2;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.ItemSwipeCallback;
|
import com.hikapro.backpack.presenter.adapters.helper.items.ItemSwipeCallback;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecoration;
|
import com.hikapro.backpack.presenter.adapters.helper.items.StickyHeaderDecoration;
|
||||||
import com.hikapro.backpack.view.View;
|
import com.hikapro.backpack.view.View;
|
||||||
|
@ -75,7 +77,9 @@ public class ItemListPresenter implements Presenter.ItemList {
|
||||||
|
|
||||||
final StickyHeaderDecoration decoration = new StickyHeaderDecoration(adapter);
|
final StickyHeaderDecoration decoration = new StickyHeaderDecoration(adapter);
|
||||||
recycler.addItemDecoration(decoration);
|
recycler.addItemDecoration(decoration);
|
||||||
recycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
//recycler.addItemDecoration(new DividerDecoration(getActivityContext()));
|
||||||
|
recycler.addItemDecoration(new DividerDecoration2(getActivityContext(), R.drawable.divider, Util.dp2px(getAppContext(), 16)));
|
||||||
|
|
||||||
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged() {
|
public void onChanged() {
|
||||||
|
@ -141,7 +145,7 @@ public class ItemListPresenter implements Presenter.ItemList {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setVisibility() {
|
public void setVisibility() {
|
||||||
if (model.getPackedQty() == model.getActiveItemsCount()) {
|
if (model.getPackedQty() > 0 && model.getPackedQty() == model.getActiveItemsCount()) {
|
||||||
footer.setVisibility(android.view.View.VISIBLE);
|
footer.setVisibility(android.view.View.VISIBLE);
|
||||||
} else if ( model.getPackedQty() > 0) {
|
} else if ( model.getPackedQty() > 0) {
|
||||||
footer.setVisibility(android.view.View.VISIBLE);
|
footer.setVisibility(android.view.View.VISIBLE);
|
||||||
|
@ -157,13 +161,8 @@ public class ItemListPresenter implements Presenter.ItemList {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showDetails(int itemId) {
|
public void showDetails(int position) {
|
||||||
Item item = model.findItem(itemId);
|
getView().showItemDetail(getCurrentSet().getId(), model, position);
|
||||||
if (item != null)
|
|
||||||
getView().showItemDetail(item, set.getId());
|
|
||||||
else
|
|
||||||
showMessage(String.format("Item with Id %d is not found.", itemId));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// process <--
|
// process <--
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ public interface Presenter {
|
||||||
Set getCurrentSet();
|
Set getCurrentSet();
|
||||||
void showMessage(String message);
|
void showMessage(String message);
|
||||||
void onSaveInstanceState(Bundle outState);
|
void onSaveInstanceState(Bundle outState);
|
||||||
void showDetails(int itemId);
|
void showDetails(int position);
|
||||||
void filter(String query);
|
void filter(String query);
|
||||||
void unpack(int setId);
|
void unpack(int setId);
|
||||||
void restore(int setId);
|
void restore(int setId);
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
package com.hikapro.backpack.presenter.adapters;
|
package com.hikapro.backpack.presenter.adapters;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Typeface;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.hikapro.backpack.R;
|
import com.hikapro.backpack.R;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
|
@ -19,7 +16,6 @@ import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipableEleme
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenu;
|
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenu;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenuItem;
|
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenuItem;
|
||||||
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenuLayout;
|
import com.hikapro.backpack.presenter.adapters.helper.items.swipe2.SwipeMenuLayout;
|
||||||
import com.hikapro.backpack.view.recycler.DetailViewHolder;
|
|
||||||
import com.hikapro.backpack.view.recycler.ItemViewHolder;
|
import com.hikapro.backpack.view.recycler.ItemViewHolder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +37,7 @@ public class ItemDetailAdapter extends RecyclerView.Adapter<ItemViewHolder> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(final ItemViewHolder holder, final int position) {
|
public void onBindViewHolder(final ItemViewHolder holder, final int position) {
|
||||||
final Item item = presenter.getModel().findItem(position);
|
final Item item = presenter.getModel().getCurrentItem();
|
||||||
holder.cb_item.setChecked(item.isPacked());
|
holder.cb_item.setChecked(item.isPacked());
|
||||||
holder.tv_text.setText(item.getName() + " " + item.getId() + " pos " + position);
|
holder.tv_text.setText(item.getName() + " " + item.getId() + " pos " + position);
|
||||||
holder.im_info.setVisibility(View.GONE);
|
holder.im_info.setVisibility(View.GONE);
|
||||||
|
|
|
@ -3,16 +3,11 @@ package com.hikapro.backpack.presenter.adapters;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
import com.hikapro.backpack.R;
|
import com.hikapro.backpack.R;
|
||||||
import com.hikapro.backpack.model.entities.Category;
|
import com.hikapro.backpack.model.entities.Category;
|
||||||
|
@ -85,7 +80,7 @@ public class ItemListAdapter extends RecyclerView.Adapter<ItemViewHolder> implem
|
||||||
holder.im_info.setOnClickListener(new View.OnClickListener() {
|
holder.im_info.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
presenter.showDetails(item.getId());
|
presenter.showDetails(position);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -224,7 +219,7 @@ public class ItemListAdapter extends RecyclerView.Adapter<ItemViewHolder> implem
|
||||||
public HeaderViewHolder onCreateHeaderViewHolder(ViewGroup parent) {
|
public HeaderViewHolder onCreateHeaderViewHolder(ViewGroup parent) {
|
||||||
HeaderViewHolder viewHolder;
|
HeaderViewHolder viewHolder;
|
||||||
View v = LayoutInflater.from(parent.getContext())
|
View v = LayoutInflater.from(parent.getContext())
|
||||||
.inflate(R.layout.view_header, parent, false);
|
.inflate(R.layout.header_element, parent, false);
|
||||||
viewHolder = new HeaderViewHolder(v);
|
viewHolder = new HeaderViewHolder(v);
|
||||||
return viewHolder;
|
return viewHolder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class PackedListAdapter extends ItemListAdapter {
|
||||||
holder.im_info.setOnClickListener(new View.OnClickListener() {
|
holder.im_info.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
presenter.showDetails(item.getId());
|
presenter.showDetails(position);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.hikapro.backpack;
|
package com.hikapro.backpack.presenter.adapters.helper;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
|
@ -6,6 +6,8 @@ import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.hikapro.backpack.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by tariel on 22/05/16.
|
* Created by tariel on 22/05/16.
|
||||||
*/
|
*/
|
||||||
|
@ -20,7 +22,7 @@ public class FlowLayout extends ViewGroup {
|
||||||
setPaddings(0,0);
|
setPaddings(0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setPaddings(int V, int H){
|
public void setPaddings(int V, int H){
|
||||||
PADDING_X = H;
|
PADDING_X = H;
|
||||||
PADDING_Y = V;
|
PADDING_Y = V;
|
||||||
}
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.hikapro.backpack.presenter.adapters.helper;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.GestureDetector;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by tariel on 16/07/16.
|
||||||
|
*/
|
||||||
|
public class OnSwipeTouchListener implements View.OnTouchListener {
|
||||||
|
|
||||||
|
private final GestureDetector gestureDetector;
|
||||||
|
|
||||||
|
public OnSwipeTouchListener(Context context) {
|
||||||
|
gestureDetector = new GestureDetector(context, new GestureListener());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSwipeLeft() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSwipeRight() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
|
return gestureDetector.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final class GestureListener extends GestureDetector.SimpleOnGestureListener {
|
||||||
|
|
||||||
|
private static final int SWIPE_DISTANCE_THRESHOLD = 100;
|
||||||
|
private static final int SWIPE_VELOCITY_THRESHOLD = 100;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onDown(MotionEvent e) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
||||||
|
float distanceX = e2.getX() - e1.getX();
|
||||||
|
float distanceY = e2.getY() - e1.getY();
|
||||||
|
if (Math.abs(distanceX) > Math.abs(distanceY) && Math.abs(distanceX) > SWIPE_DISTANCE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) {
|
||||||
|
if (distanceX > 0)
|
||||||
|
onSwipeRight();
|
||||||
|
else
|
||||||
|
onSwipeLeft();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,8 @@ import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.hikapro.backpack.presenter.adapters.helper.Util;
|
||||||
|
|
||||||
|
|
||||||
public class DividerDecoration extends RecyclerView.ItemDecoration {
|
public class DividerDecoration extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.hikapro.backpack.presenter.adapters.helper.items;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by tariel on 19/07/16.
|
||||||
|
*/
|
||||||
|
public class DividerDecoration2 extends RecyclerView.ItemDecoration {
|
||||||
|
|
||||||
|
private static final int[] ATTRS = new int[]{android.R.attr.listDivider};
|
||||||
|
private int paddingX;
|
||||||
|
|
||||||
|
private Drawable mDivider;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default divider will be used
|
||||||
|
*/
|
||||||
|
public DividerDecoration2(Context context) {
|
||||||
|
final TypedArray styledAttributes = context.obtainStyledAttributes(ATTRS);
|
||||||
|
mDivider = styledAttributes.getDrawable(0);
|
||||||
|
styledAttributes.recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Custom divider will be used
|
||||||
|
*/
|
||||||
|
public DividerDecoration2(Context context, int resId) {
|
||||||
|
mDivider = ContextCompat.getDrawable(context, resId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DividerDecoration2(Context context, int resId, int paddingX) {
|
||||||
|
mDivider = ContextCompat.getDrawable(context, resId);
|
||||||
|
this.paddingX = paddingX;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||||
|
int left = parent.getPaddingLeft();
|
||||||
|
int right = parent.getWidth() - parent.getPaddingRight();
|
||||||
|
|
||||||
|
int childCount = parent.getChildCount();
|
||||||
|
for (int i = 0; i < childCount; i++) {
|
||||||
|
View child = parent.getChildAt(i);
|
||||||
|
|
||||||
|
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||||
|
|
||||||
|
int top = child.getBottom() + params.bottomMargin;
|
||||||
|
int bottom = top + mDivider.getIntrinsicHeight();
|
||||||
|
|
||||||
|
mDivider.setBounds(left + paddingX, top, right - paddingX, bottom);
|
||||||
|
mDivider.draw(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -67,9 +67,12 @@ public class SwipableRecycler extends RecyclerView {
|
||||||
if (lastTouchedElement != null && lastTouchedElement.isOpen() && lastTouchedElement != buf) {
|
if (lastTouchedElement != null && lastTouchedElement.isOpen() && lastTouchedElement != buf) {
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
|
// on click
|
||||||
|
/*
|
||||||
if (lastTouchedElement != null && lastTouchedElement.isOpen() && inRangeOfView(lastTouchedElement.getMenuView(), e)) {
|
if (lastTouchedElement != null && lastTouchedElement.isOpen() && inRangeOfView(lastTouchedElement.getMenuView(), e)) {
|
||||||
lastTouchedElement.getMenuView().notifyOnClick(e.getRawX(), e.getRawY());
|
lastTouchedElement.getMenuView().notifyOnClick(e.getRawX(), e.getRawY());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (lastTouchedElement != null)
|
if (lastTouchedElement != null)
|
||||||
lastTouchedElement.onSwipe(e);
|
lastTouchedElement.onSwipe(e);
|
||||||
return handled;
|
return handled;
|
||||||
|
@ -88,6 +91,13 @@ public class SwipableRecycler extends RecyclerView {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
// TODO del
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
// on click
|
||||||
|
if (lastTouchedElement != null && lastTouchedElement.isOpen() && inRangeOfView(lastTouchedElement.getMenuView(), e)) {
|
||||||
|
lastTouchedElement.getMenuView().notifyOnClick(e.getRawX(), e.getRawY());
|
||||||
|
}
|
||||||
|
return super.onInterceptTouchEvent(e);
|
||||||
}
|
}
|
||||||
return super.onInterceptTouchEvent(e);
|
return super.onInterceptTouchEvent(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.hikapro.backpack.view;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
import com.hikapro.backpack.model.entities.Set;
|
import com.hikapro.backpack.model.entities.Set;
|
||||||
import com.hikapro.backpack.presenter.Presenter;
|
import com.hikapro.backpack.presenter.Presenter;
|
||||||
|
@ -25,14 +26,13 @@ public interface View {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ItemList extends Base {
|
interface ItemList extends Base {
|
||||||
void showItemDetail(Item item, int setId);
|
void showItemDetail(int setId, Model.Item baseModel, int position);
|
||||||
void showPackedItems(Set set);
|
void showPackedItems(Set set);
|
||||||
void setPresenter(Presenter.ItemList presenter);
|
void setPresenter(Presenter.ItemList presenter);
|
||||||
Set getSet();
|
Set getSet();
|
||||||
}
|
}
|
||||||
interface ItemDetail extends Base {
|
interface ItemDetail extends Base {
|
||||||
void setPresenter(Presenter.ItemDetail presenter);
|
void setPresenter(Presenter.ItemDetail presenter);
|
||||||
Item getItem();
|
|
||||||
int getSetId();
|
int getSetId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public interface View {
|
||||||
void startSetListFragment();
|
void startSetListFragment();
|
||||||
void startItemListFragment(Set set);
|
void startItemListFragment(Set set);
|
||||||
void startPackedListFragment(Set set);
|
void startPackedListFragment(Set set);
|
||||||
void startItemDetailFragment(Item item, int setId);
|
void startItemDetailFragment(int setId, Model.Item baseModel, int position);
|
||||||
void startShareFragment(int setId);
|
void startShareFragment(int setId);
|
||||||
void startAddFragment(Set set);
|
void startAddFragment(Set set);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@ import com.hikapro.backpack.presenter.Presenter;
|
||||||
*/
|
*/
|
||||||
public class ItemDetailFragment extends Fragment implements com.hikapro.backpack.view.View.ItemDetail {
|
public class ItemDetailFragment extends Fragment implements com.hikapro.backpack.view.View.ItemDetail {
|
||||||
|
|
||||||
private static final String BUNDLE_ITEM_KEY = "BUNDLE_ITEM_KEY";
|
|
||||||
private static final String BUNDLE_SET_KEY = "BUNDLE_SET_KEY";
|
private static final String BUNDLE_SET_KEY = "BUNDLE_SET_KEY";
|
||||||
|
|
||||||
private Presenter.ItemDetail presenter;
|
private Presenter.ItemDetail presenter;
|
||||||
|
@ -37,10 +36,9 @@ public class ItemDetailFragment extends Fragment implements com.hikapro.backpack
|
||||||
return new ItemDetailFragment();
|
return new ItemDetailFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemDetailFragment newInstance(Item item, int setId) {
|
public static ItemDetailFragment newInstance(int setId) {
|
||||||
ItemDetailFragment ret = ItemDetailFragment.construct();
|
ItemDetailFragment ret = ItemDetailFragment.construct();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putSerializable(BUNDLE_ITEM_KEY, item);
|
|
||||||
args.putInt(BUNDLE_SET_KEY, setId);
|
args.putInt(BUNDLE_SET_KEY, setId);
|
||||||
ret.setArguments(args);
|
ret.setArguments(args);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -142,13 +140,6 @@ public class ItemDetailFragment extends Fragment implements com.hikapro.backpack
|
||||||
return this.getActivity();
|
return this.getActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getItem() {
|
|
||||||
Bundle args = getArguments();
|
|
||||||
Item item = (Item) args.getSerializable(BUNDLE_ITEM_KEY);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSetId() {
|
public int getSetId() {
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
|
|
|
@ -17,6 +17,7 @@ import android.widget.SearchView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.hikapro.backpack.R;
|
import com.hikapro.backpack.R;
|
||||||
|
import com.hikapro.backpack.model.Model;
|
||||||
import com.hikapro.backpack.model.entities.Item;
|
import com.hikapro.backpack.model.entities.Item;
|
||||||
import com.hikapro.backpack.model.entities.Set;
|
import com.hikapro.backpack.model.entities.Set;
|
||||||
import com.hikapro.backpack.presenter.Presenter;
|
import com.hikapro.backpack.presenter.Presenter;
|
||||||
|
@ -178,10 +179,11 @@ public class ItemListFragment extends Fragment implements com.hikapro.backpack.v
|
||||||
|
|
||||||
// life cycle <--
|
// life cycle <--
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showItemDetail(Item item, int setId) {
|
public void showItemDetail(int setId, Model.Item baseModel, int position) {
|
||||||
activityCallback.startItemDetailFragment(item, setId);
|
activityCallback.startItemDetailFragment(setId, baseModel, position);
|
||||||
}//TODO del?
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showPackedItems(Set set) {
|
public void showPackedItems(Set set) {
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package com.hikapro.backpack.view.recycler;
|
|
||||||
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.hikapro.backpack.R;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by tariel on 23/04/16.
|
|
||||||
*/
|
|
||||||
public class DetailViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
public TextView title;
|
|
||||||
public TextView description;
|
|
||||||
public ImageView photo;
|
|
||||||
|
|
||||||
public DetailViewHolder(View v) {
|
|
||||||
super(v);
|
|
||||||
setupViews(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupViews(View view) {
|
|
||||||
title = (TextView) view.findViewById(R.id.item_title);
|
|
||||||
description = (TextView) view.findViewById(R.id.item_description);
|
|
||||||
photo = (ImageView) view.findViewById(R.id.item_photo);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.hikapro.backpack.view.recycler;
|
|
||||||
|
|
||||||
import android.support.v7.widget.RecyclerView;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
|
|
||||||
import com.hikapro.backpack.R;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by tariel on 01/05/16.
|
|
||||||
*/
|
|
||||||
public class ItemViewHolderCopy extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
public int id;
|
|
||||||
public CheckBox checkBox;
|
|
||||||
public Button leaveAtHomeButton;
|
|
||||||
public Button deleteButton;
|
|
||||||
public ImageButton infoButton;
|
|
||||||
public ViewGroup swipeGroup;
|
|
||||||
|
|
||||||
public ItemViewHolderCopy(View v) {
|
|
||||||
super(v);
|
|
||||||
setupViews(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupViews(View view) {
|
|
||||||
infoButton = (ImageButton) view.findViewById(R.id.info_button);
|
|
||||||
checkBox = (CheckBox) view.findViewById(R.id.item_checkbox);
|
|
||||||
leaveAtHomeButton = (Button) view.findViewById(R.id.leave_at_home_button);
|
|
||||||
deleteButton = (Button) view.findViewById(R.id.delete_button);
|
|
||||||
swipeGroup = (ViewGroup) view.findViewById((R.id.swipe_container));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#000000" />
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
<stroke android:width="2px" android:color="#FFFFFF" />
|
||||||
|
</shape>
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<size android:height="2dp" />
|
||||||
|
<solid android:color="#ff992900" />
|
||||||
|
</shape>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<gradient android:startColor="#FFFFFF"
|
||||||
|
android:endColor="#00FF00"
|
||||||
|
android:angle="270" />
|
||||||
|
<corners android:radius="3dp" />
|
||||||
|
<stroke android:width="5px" android:color="#000000" />
|
||||||
|
</shape>
|
|
@ -9,14 +9,14 @@
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/action_add_cancel"
|
android:id="@+id/action_add_cancel"
|
||||||
style="@style/ActionBarButtonWhite"
|
style="@style/ActionBarButtonWhite"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="@string/cancel_button"
|
android:text="@string/cancel_button"
|
||||||
android:layout_alignParentStart="true"/>
|
android:layout_alignParentStart="true"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:text="ADD AN ITEM"
|
android:text="ADD AN ITEM"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/action_add_save"
|
android:id="@+id/action_add_save"
|
||||||
style="@style/ActionBarButtonWhite"
|
style="@style/ActionBarButtonWhite"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="@string/save_button"
|
android:text="@string/save_button"
|
||||||
android:layout_alignParentEnd="true"/>
|
android:layout_alignParentEnd="true"/>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,14 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Button xmlns:android="http://schemas.android.com/apk/res/android"
|
<Button xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
style="?android:attr/buttonStyleSmall"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/margin_standard"
|
android:textColor="@android:color/white"
|
||||||
android:paddingLeft="@dimen/margin_standard">
|
android:background="@drawable/cat_btn_bg"
|
||||||
|
android:paddingRight="25dp"
|
||||||
|
android:paddingLeft="25dp"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
|
android:textSize="@dimen/text_category_btn"
|
||||||
|
>
|
||||||
</Button>
|
</Button>
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -2,22 +2,23 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="66dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:id="@+id/item_list_footer"
|
android:id="@+id/item_list_footer"
|
||||||
android:background="@color/colorFooterbackground"
|
android:background="@color/colorFooterBackground"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom">
|
||||||
>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:textColor="@color/colorFooterTextWhite"
|
||||||
android:id="@+id/footer_packed_count"/>
|
android:id="@+id/footer_packed_count"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:textColor="@color/colorFooterTextGreen"
|
||||||
android:text="@string/what_in_bag"
|
android:text="@string/what_in_bag"
|
||||||
android:id="@+id/open_packed"/>
|
android:id="@+id/open_packed"/>
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
tools:context="com.hikapro.backpack.view.fragments.AddFragment"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/colorListBackground">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
android:id="@+id/fragment_add_main_layout"
|
android:id="@+id/fragment_add_main_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
tools:context="com.hikapro.backpack.view.fragments.AddFragment">
|
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -14,35 +20,39 @@
|
||||||
<android.widget.SearchView
|
<android.widget.SearchView
|
||||||
android:id="@+id/add_search"
|
android:id="@+id/add_search"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="match_parent"
|
||||||
|
android:textColor="@color/colorText"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/add_item_recycler"
|
android:id="@+id/add_item_recycler"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
</android.support.v7.widget.RecyclerView>
|
</android.support.v7.widget.RecyclerView>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/add_item_category_container"
|
android:id="@+id/add_item_category_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="@dimen/margin_standard">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/add_item_category_label"
|
android:id="@+id/add_item_category_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/choose_category"/>
|
android:layout_marginTop="@dimen/margin_standard"
|
||||||
|
android:layout_marginBottom="@dimen/margin_standard"
|
||||||
|
android:text="@string/choose_category"
|
||||||
|
android:textColor="@color/colorText"/>
|
||||||
|
|
||||||
<com.hikapro.backpack.FlowLayout
|
<com.hikapro.backpack.presenter.adapters.helper.FlowLayout
|
||||||
android:id="@+id/add_item_category_flow"
|
android:id="@+id/add_item_category_flow"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/add_item_category_label">
|
android:layout_below="@+id/add_item_category_label">
|
||||||
|
</com.hikapro.backpack.presenter.adapters.helper.FlowLayout>
|
||||||
</com.hikapro.backpack.FlowLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
|
@ -35,6 +35,25 @@
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:contentDescription="@string/cd_item_image"/>
|
android:contentDescription="@string/cd_item_image"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/detail_progress_container"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:visibility="gone">
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/set_progress"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="32dp"
|
||||||
|
android:paddingEnd="32dp"
|
||||||
|
android:paddingBottom="32dp"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
style="@android:style/Widget.ProgressBar.Large"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:layout_marginEnd="5dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_description"
|
android:id="@+id/item_description"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
|
@ -49,7 +68,7 @@
|
||||||
android:paddingTop="20dp"
|
android:paddingTop="20dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/colorUiSecondaryFont"
|
android:textColor="@color/colorFooterTextGreen"
|
||||||
android:text="@string/more"/>
|
android:text="@string/more"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -31,17 +31,17 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/size_item_packed"
|
android:textSize="@dimen/text_footer"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/colorUiSecondaryFont"
|
android:textColor="@color/colorFooterTextWhite"
|
||||||
android:id="@+id/footer_packed_count"/>
|
android:id="@+id/footer_packed_count"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/size_item_packed"
|
android:textSize="@dimen/text_footer"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/colorUiSecondaryFont"
|
android:textColor="@color/colorFooterTextGreen"
|
||||||
android:text="@string/what_in_bag"
|
android:text="@string/what_in_bag"
|
||||||
android:id="@+id/open_packed"/>
|
android:id="@+id/open_packed"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -18,18 +18,18 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/size_item_packed"
|
android:textSize="@dimen/text_footer"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/colorUiSecondaryFont"
|
android:textColor="@color/colorFooterTextWhite"
|
||||||
android:id="@+id/header_packed_count"/>
|
android:id="@+id/header_packed_count"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:textSize="@dimen/size_item_packed"
|
android:textSize="@dimen/text_footer"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textColor="@color/colorUiSecondaryFont"
|
android:textColor="@color/colorFooterTextGreen"
|
||||||
android:text="@string/continue_packing"
|
android:text="@string/continue_packing"
|
||||||
android:id="@+id/back_to_list"/>
|
android:id="@+id/back_to_list"/>
|
||||||
<Button
|
<Button
|
||||||
|
@ -37,12 +37,12 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/unpack_button"
|
android:text="@string/unpack_button"
|
||||||
android:textSize="@dimen/size_btn_unpack_txt"
|
android:textSize="@dimen/text_action_bar_header"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:background="@color/colorUnpackBtnBackground"
|
android:background="@color/colorUnpackBackground"
|
||||||
android:layout_marginTop="@dimen/margin_standard"
|
android:layout_marginTop="@dimen/margin_standard"
|
||||||
android:layout_marginBottom="@dimen/margin_standard"
|
android:layout_marginBottom="@dimen/margin_standard"
|
||||||
android:visibility="invisible"/>
|
android:visibility="gone"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -3,14 +3,15 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:background="@color/colorMainBackground">
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/set_recycler"
|
android:id="@+id/set_recycler"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/colorUiMainbackground"/>
|
android:background="@color/colorListBackground"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/set_progress_container"
|
android:id="@+id/set_progress_container"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="com.hikapro.backpack.view.fragments.ShareFragment"
|
tools:context="com.hikapro.backpack.view.fragments.ShareFragment"
|
||||||
android:background="#D3D3D3">
|
android:background="@color/colorListBackground">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/share_image_view"
|
android:id="@+id/share_image_view"
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:background="@color/colorListBackground"
|
||||||
|
android:textSize="@dimen/text_category_name"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
android:id="@+id/header"
|
||||||
|
tools:context=".MainActivity"/>
|
||||||
|
<!--
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="2dip"
|
||||||
|
android:background="#FF00FF00">
|
||||||
|
</View>
|
||||||
|
-->
|
||||||
|
</LinearLayout>
|
|
@ -12,13 +12,16 @@
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:paddingStart="@dimen/activity_horizontal_margin"
|
android:paddingStart="@dimen/activity_horizontal_margin"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textSize="@dimen/size_item_name_big"/>
|
android:textColor="@color/colorText"
|
||||||
|
android:textSize="@dimen/text_item_name"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/add_item_category"
|
android:id="@+id/add_item_category"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/add_item_name"
|
android:layout_below="@id/add_item_name"
|
||||||
|
android:textSize="@dimen/text_item_category"
|
||||||
|
android:textColor="@color/colorCategory"
|
||||||
android:layout_alignLeft="@id/add_item_name"
|
android:layout_alignLeft="@id/add_item_name"
|
||||||
android:paddingTop="6dp"
|
android:paddingTop="6dp"
|
||||||
android:paddingStart="@dimen/activity_horizontal_margin"/>
|
android:paddingStart="@dimen/activity_horizontal_margin"/>
|
||||||
|
@ -28,6 +31,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/already_in_list"
|
android:text="@string/already_in_list"
|
||||||
|
android:textSize="@dimen/text_item_category"
|
||||||
android:textColor="@color/save_green"
|
android:textColor="@color/save_green"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
|
|
@ -18,12 +18,11 @@
|
||||||
android:id="@+id/item_description"
|
android:id="@+id/item_description"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/colorUiMainFont" />
|
android:textColor="@color/colorDescriptionText" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/item_link"
|
android:id="@+id/item_link"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/colorUiMainFont"/>
|
android:textColor="@color/colorLinkText"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,37 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:paddingBottom="@dimen/margin_standard"
|
|
||||||
android:paddingLeft="@dimen/margin_standard"
|
|
||||||
android:paddingRight="@dimen/margin_standard"
|
|
||||||
android:paddingTop="@dimen/margin_standard">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/item_title"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:textColor="@color/colorUiMainFont"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/item_photo"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/item_title"
|
|
||||||
android:layout_marginTop="@dimen/margin_standard_plus_plus"
|
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:contentDescription="@string/cd_item_image"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/item_description"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/item_photo"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:textColor="@color/colorUiMainFont"
|
|
||||||
android:layout_marginTop="@dimen/margin_standard_plus_plus" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
|
@ -25,8 +25,8 @@
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="@dimen/margin_standard"
|
android:layout_marginStart="@dimen/margin_standard"
|
||||||
android:layout_marginEnd="@dimen/margin_standard"
|
android:layout_marginEnd="@dimen/margin_standard"
|
||||||
android:textSize="@dimen/size_item_name"
|
android:textSize="@dimen/text_item_name"
|
||||||
android:textColor="@color/colorUiMainFont" />
|
android:textColor="@color/colorText" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:customNS="com.hikapro.backpack"
|
||||||
android:id="@+id/sticky_header_container"
|
android:id="@+id/sticky_header_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"/>
|
android:layout_height="wrap_content"
|
||||||
|
customNS:paddingY="15dp"
|
||||||
|
customNS:paddingX="15dp" />
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.hikapro.backpack.FlowLayout
|
<com.hikapro.backpack.presenter.adapters.helper.FlowLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -82,8 +82,8 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Text 1"
|
android:text="Text 1"
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="150dp"
|
||||||
android:paddingTop="15dp"/>
|
android:paddingTop="150dp"/>
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -91,4 +91,4 @@
|
||||||
android:paddingLeft="15dp"
|
android:paddingLeft="15dp"
|
||||||
android:paddingTop="15dp"/>
|
android:paddingTop="15dp"/>
|
||||||
|
|
||||||
</com.hikapro.backpack.FlowLayout>
|
</com.hikapro.backpack.presenter.adapters.helper.FlowLayout>
|
|
@ -1,31 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<FrameLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/save_menu_item"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:divider="?android:attr/dividerVertical"
|
|
||||||
android:showDividers="end"
|
|
||||||
android:dividerPadding="12dip"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:duplicateParentState="true"
|
|
||||||
style="?android:attr/actionButtonStyle">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginRight="20dip"
|
|
||||||
android:textColor="@color/colorUiMainFont"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:text="Done"
|
|
||||||
style="@android:style/Widget.Holo.ActionBar.TabText" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
|
|
@ -1,25 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:enabled="false"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
<!-- android:paddingEnd="0dip" --> >
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/action_cancel"
|
|
||||||
style="@style/ActionBarButtonWhite"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:text="CANCEL"
|
|
||||||
android:gravity="left|center_vertical"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/action_add"
|
|
||||||
style="@style/ActionBarButtonWhite"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:text="SAVE"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="16dp"
|
|
||||||
android:background="@color/colorStickyHeaderBackground"
|
|
||||||
android:textSize="@dimen/size_sticky_header"
|
|
||||||
android:textStyle="bold"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:id="@+id/header"
|
|
||||||
tools:context=".MainActivity"/>
|
|
|
@ -1,64 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
|
|
||||||
<FrameLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/item_height"
|
|
||||||
>
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
<CheckBox
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="@dimen/item_checkbox_padding"
|
|
||||||
android:textSize="@dimen/size_item_name"
|
|
||||||
android:id="@+id/item_checkbox"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_marginLeft="@dimen/margin_standard"
|
|
||||||
android:textColor="@color/colorUiMainFont"
|
|
||||||
tools:context=".MainActivity"/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/info_button"
|
|
||||||
android:src="@drawable/ic_info_black_24dp"
|
|
||||||
android:background="@null"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginLeft="@dimen/margin_standard"
|
|
||||||
android:layout_marginRight="@dimen/margin_standard"
|
|
||||||
/>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/swipe_container"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="end|center_vertical">
|
|
||||||
<Button
|
|
||||||
android:id="@+id/leave_at_home_button"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/leave_at_home_button"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
android:layout_gravity="end|center_vertical"
|
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless"
|
|
||||||
android:background="@android:color/darker_gray"/>
|
|
||||||
<Button
|
|
||||||
android:id="@+id/delete_button"
|
|
||||||
android:layout_width="100dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="@string/delete_button"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textColor="@android:color/white"
|
|
||||||
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
|
|
||||||
android:background="@android:color/holo_red_dark"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
|
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
|
||||||
|
<item name="android:textAllCaps">false</item>
|
||||||
|
<item name="android:editTextColor">@color/colorText</item>
|
||||||
|
<item name="android:textColorHint">@color/colorDescriptionText</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ActionBarButton">
|
<style name="ActionBarButton">
|
||||||
|
|
|
@ -11,4 +11,21 @@
|
||||||
<color name="colorLeaveAtHomeBtnBackground">#C9C9CE</color>
|
<color name="colorLeaveAtHomeBtnBackground">#C9C9CE</color>
|
||||||
<color name="colorAddToBagBtnBackground">#76EE00</color>
|
<color name="colorAddToBagBtnBackground">#76EE00</color>
|
||||||
<color name="colorReturnToListBtnBackground">#C9C9CE</color>
|
<color name="colorReturnToListBtnBackground">#C9C9CE</color>
|
||||||
|
|
||||||
|
<color name="colorMainBackground">#252525</color>
|
||||||
|
<color name="colorListBackground">#1F1F1F</color>
|
||||||
|
<color name="colorElementEnabled">#68B61F</color>
|
||||||
|
<color name="colorActionBarTitle">#DFDFDF</color>
|
||||||
|
<color name="colorFooterTextGreen">#7ED321</color>
|
||||||
|
<color name="colorFooterTextWhite">#DCDCDC</color>
|
||||||
|
<color name="colorUnpackBackground">#7ED321</color>
|
||||||
|
<color name="colorText">#FFFFFF</color>
|
||||||
|
<color name="colorCategory">#DFDFDF</color>
|
||||||
|
<color name="colorFooterBackground">#76000000</color>
|
||||||
|
<color name="colorSwipeGreenBackground">#436D15</color>
|
||||||
|
<color name="colorSwipeGreyBackground">#555454</color>
|
||||||
|
<color name="colorSwipeRedBackground">#AF00</color>
|
||||||
|
<color name="colorDescriptionText">#9C9C9C</color>
|
||||||
|
<color name="colorLinkText">#76EE00</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -12,5 +12,17 @@
|
||||||
<dimen name="text_size_small">14sp</dimen>
|
<dimen name="text_size_small">14sp</dimen>
|
||||||
<dimen name="text_size_medium">16sp</dimen>
|
<dimen name="text_size_medium">16sp</dimen>
|
||||||
|
|
||||||
|
<dimen name="text_action_bar_header">14sp</dimen>
|
||||||
|
<dimen name="text_item_header">12sp</dimen>
|
||||||
|
<dimen name="text_item_name">18sp</dimen>
|
||||||
|
<dimen name="text_category_name">12sp</dimen>
|
||||||
|
<dimen name="text_item_category">10sp</dimen>
|
||||||
|
<dimen name="text_footer">14sp</dimen>
|
||||||
|
<dimen name="text_category_btn">13sp</dimen>
|
||||||
|
<dimen name="text_action_bar_btn">12sp</dimen>
|
||||||
|
<dimen name="text_item_description">17sp</dimen>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
|
@ -8,7 +8,7 @@
|
||||||
<string name="what_in_bag">Show what\'s in my bag ↓</string>
|
<string name="what_in_bag">Show what\'s in my bag ↓</string>
|
||||||
<string name="choose_category">Choose item category:</string>
|
<string name="choose_category">Choose item category:</string>
|
||||||
<string name="continue_packing">Continue with my packing ↑</string>
|
<string name="continue_packing">Continue with my packing ↑</string>
|
||||||
<string name="already_in_list">Already in List</string>
|
<string name="already_in_list">✓ Already in list</string>
|
||||||
<string name="what_is_it">WHAT IS IT?</string>
|
<string name="what_is_it">WHAT IS IT?</string>
|
||||||
<string name="more">More about this item ❭</string>
|
<string name="more">More about this item ❭</string>
|
||||||
|
|
||||||
|
|
|
@ -6,25 +6,29 @@
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
<item name="colorAccent">@color/colorAccent</item>
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
<item name="android:editTextColor">@color/colorText</item>
|
||||||
|
<item name="android:textColorHint">@color/colorDescriptionText</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ActionBarButton">
|
<style name="ActionBarButton" parent="@style/ThemeOverlay.AppCompat.Dark">
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:ellipsize">end</item>
|
<item name="android:ellipsize">end</item>
|
||||||
<item name="android:singleLine">true</item>
|
<item name="android:singleLine">true</item>
|
||||||
<item name="android:textSize">@dimen/text_size_small</item>
|
<item name="android:textSize">@dimen/text_action_bar_btn</item>
|
||||||
<item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
|
<item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center</item>
|
||||||
|
<item name="android:background">@null</item>
|
||||||
<!--<item name="android:background">@drawable/ripple</item>-->
|
<!--<item name="android:background">@drawable/ripple</item>-->
|
||||||
<!-- <item name="android:background">?android:attr/selectableItemBackground</item> -->
|
<!-- <item name="android:background">?android:attr/selectableItemBackground</item> -->
|
||||||
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
<!--
|
||||||
|
<item name="android:background">?attr/selectableItemBackgroundBorderless</item>
|
||||||
|
-->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ActionBarButtonWhite" parent="@style/ActionBarButton">
|
<style name="ActionBarButtonWhite" parent="@style/ActionBarButton">
|
||||||
<item name="android:textColor">@color/white</item>
|
<item name="android:textColor">@color/white</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ActionBarButtonOffWhite" parent="@style/ActionBarButton">
|
<style name="ActionBarButtonOffWhite" parent="@style/ActionBarButton">
|
||||||
|
|
Loading…
Reference in New Issue