Mulberry View UI first adjustMulberryView functions for M70, M30, M20
This commit is contained in:
parent
fbf7b99501
commit
50796a6951
|
@ -6,6 +6,8 @@ import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.dspread.pos.common.base.BaseFragment;
|
import com.dspread.pos.common.base.BaseFragment;
|
||||||
import com.dspread.pos.TitleProviderListener;
|
import com.dspread.pos.TitleProviderListener;
|
||||||
import com.dspread.pos.ui.main.MainActivity;
|
import com.dspread.pos.ui.main.MainActivity;
|
||||||
|
@ -19,7 +21,17 @@ public class MulberryFragment extends BaseFragment<FragmentMulberryBinding, Mulb
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initViewObservable() {
|
public void initViewObservable() {
|
||||||
// Observe item click events
|
// Call this after view is created
|
||||||
|
RecyclerView recyclerView = binding.getRoot().findViewById(R.id.mulberryCards_list);
|
||||||
|
|
||||||
|
viewModel.adjustMulberryView(binding.ivLogo,
|
||||||
|
binding.topLogoContainer,
|
||||||
|
binding.footerContainer,
|
||||||
|
binding.centerContainer,
|
||||||
|
binding.getRoot()
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
// Handle fragment navigation
|
// Handle fragment navigation
|
||||||
viewModel.navigateToFragment.observe(this, fragmentId -> {
|
viewModel.navigateToFragment.observe(this, fragmentId -> {
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
|
|
|
@ -7,18 +7,24 @@ import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.GridLayout;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.cardview.widget.CardView;
|
||||||
import androidx.databinding.Observable;
|
import androidx.databinding.Observable;
|
||||||
import androidx.databinding.ObservableArrayList;
|
import androidx.databinding.ObservableArrayList;
|
||||||
import androidx.databinding.ObservableField;
|
import androidx.databinding.ObservableField;
|
||||||
import androidx.databinding.ObservableList;
|
import androidx.databinding.ObservableList;
|
||||||
import androidx.lifecycle.LiveData;
|
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.dspread.pos.common.base.BaseAppViewModel;
|
import com.dspread.pos.common.base.BaseAppViewModel;
|
||||||
import com.dspread.pos.data.local.PreferencesManager;
|
import com.dspread.pos.data.local.PreferencesManager;
|
||||||
import com.dspread.pos.utils.ImageUtils;
|
|
||||||
import com.dspread.pos.utils.PosParameters;
|
import com.dspread.pos.utils.PosParameters;
|
||||||
import com.dspread.pos.utils.TRACE;
|
import com.dspread.pos.utils.TRACE;
|
||||||
import com.dspread.pos_android_app.BR;
|
import com.dspread.pos_android_app.BR;
|
||||||
|
@ -35,11 +41,23 @@ import java.util.Map;
|
||||||
|
|
||||||
import me.tatarka.bindingcollectionadapter2.ItemBinding;
|
import me.tatarka.bindingcollectionadapter2.ItemBinding;
|
||||||
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
|
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;
|
||||||
import me.goldze.mvvmhabit.base.ItemViewModel;
|
|
||||||
|
|
||||||
public class MulberryViewModel extends BaseAppViewModel {
|
public class MulberryViewModel extends BaseAppViewModel {
|
||||||
private static final String TAG = "MulberryVM";
|
private static final String TAG = "MulberryVM";
|
||||||
|
|
||||||
|
// Device type constants
|
||||||
|
private static final int DEVICE_TYPE_SMALL = 1; // D20, D30, D30M
|
||||||
|
private static final int DEVICE_TYPE_COMPACT = 2; // D70 (wide but small)
|
||||||
|
private static final int DEVICE_TYPE_LARGE = 3; // D80, D80K, others
|
||||||
|
|
||||||
|
private int currentDeviceType;
|
||||||
|
|
||||||
|
// Device-specific observables
|
||||||
|
public final ObservableField<Integer> logoHeight = new ObservableField<>();
|
||||||
|
public final ObservableField<Integer> gridSpanCount = new ObservableField<>();
|
||||||
|
public final ObservableField<Integer> maxNavItems = new ObservableField<>();
|
||||||
|
public final ObservableField<Integer> cardImageSize = new ObservableField<>();
|
||||||
|
|
||||||
// UI Observables
|
// UI Observables
|
||||||
public final ObservableField<Integer> mainLogo = new ObservableField<>();
|
public final ObservableField<Integer> mainLogo = new ObservableField<>();
|
||||||
public final ObservableField<Integer> footerLogo = new ObservableField<>();
|
public final ObservableField<Integer> footerLogo = new ObservableField<>();
|
||||||
|
@ -63,23 +81,26 @@ public class MulberryViewModel extends BaseAppViewModel {
|
||||||
private final Map<String, Bitmap> imageCache = new HashMap<>();
|
private final Map<String, Bitmap> imageCache = new HashMap<>();
|
||||||
private final MutableLiveData<Boolean> imagesLoaded = new MutableLiveData<>(false);
|
private final MutableLiveData<Boolean> imagesLoaded = new MutableLiveData<>(false);
|
||||||
|
|
||||||
|
// Provide height in pixels, not dp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public MulberryViewModel(@NonNull Application application) {
|
public MulberryViewModel(@NonNull Application application) {
|
||||||
super(application);
|
super(application);
|
||||||
TRACE.i("Mulberry fragment init");
|
TRACE.i("Mulberry fragment init");
|
||||||
Log.d(TAG, "MulberryViewModel constructor called");
|
Log.d(TAG, "MulberryViewModel constructor called");
|
||||||
|
|
||||||
|
|
||||||
// Add this to track initialization
|
// Add this to track initialization
|
||||||
Log.d(TAG, "ViewModel hash: " + this.hashCode());
|
Log.d(TAG, "ViewModel hash: " + this.hashCode());
|
||||||
if (Build.MODEL.equalsIgnoreCase("D70") ||
|
// if (Build.MODEL.equalsIgnoreCase("D70") ||
|
||||||
Build.MODEL.equalsIgnoreCase("D30") ||
|
// Build.MODEL.equalsIgnoreCase("D30") ||
|
||||||
Build.MODEL.equalsIgnoreCase("D30M") ||
|
// Build.MODEL.equalsIgnoreCase("D30M") ||
|
||||||
Build.MODEL.equalsIgnoreCase("D80")||
|
// Build.MODEL.equalsIgnoreCase("D80")||
|
||||||
Build.MODEL.equalsIgnoreCase("D80K")) {
|
// Build.MODEL.equalsIgnoreCase("D80K")) {
|
||||||
Log.d("Build.MODEL", "MainViewModel: " + Build.MODEL);;
|
// Log.d("Build.MODEL", "MainViewModel: " + Build.MODEL);;
|
||||||
// To-Do set small size of logo ,and grid size 3 by 1
|
// // To-Do set small size of logo ,and grid size 3 by 1
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Observe WebSocket connection status
|
// Observe WebSocket connection status
|
||||||
getWebSocketConnectionStatus().observeForever(isConnected -> {
|
getWebSocketConnectionStatus().observeForever(isConnected -> {
|
||||||
|
@ -99,6 +120,82 @@ public class MulberryViewModel extends BaseAppViewModel {
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void adjustMulberryView(ImageView logoImageView,
|
||||||
|
LinearLayout containerLayout,
|
||||||
|
LinearLayout footerContainer,
|
||||||
|
LinearLayout centerContainer,
|
||||||
|
|
||||||
|
View rootView
|
||||||
|
) {
|
||||||
|
// Find RecyclerView from root view
|
||||||
|
|
||||||
|
String model = Build.MODEL.toUpperCase();
|
||||||
|
int heightPx = 150; // default (~100dp)
|
||||||
|
int paddingPx = 10 ; // default 10dp
|
||||||
|
|
||||||
|
if (model.contains("D70")) {
|
||||||
|
heightPx = 20; // 20dp for D70
|
||||||
|
paddingPx = 2 ; // 2dp for D70
|
||||||
|
|
||||||
|
containerLayout.setVisibility(View.GONE);
|
||||||
|
footerContainer.setVisibility(View.GONE);
|
||||||
|
centerContainer.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
// Adjust GridLayout columnCount
|
||||||
|
RecyclerView recyclerView = rootView.findViewById(R.id.mulberryCards_list);
|
||||||
|
if (recyclerView != null && recyclerView.getLayoutManager() instanceof GridLayoutManager) {
|
||||||
|
GridLayoutManager layoutManager = (GridLayoutManager) recyclerView.getLayoutManager();
|
||||||
|
layoutManager.setSpanCount(3);
|
||||||
|
// Set padding on the RecyclerView (not LayoutManager)
|
||||||
|
recyclerView.setPadding(0, 1, 0, 1);
|
||||||
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
|
}
|
||||||
|
// Adjust CardView size
|
||||||
|
CardView cardView = rootView.findViewById(R.id.widget_card);
|
||||||
|
if (cardView != null) {
|
||||||
|
int sizeInPx = 80; // Convert 120dp to pixels
|
||||||
|
ViewGroup.LayoutParams params = cardView.getLayoutParams();
|
||||||
|
params.width = sizeInPx;
|
||||||
|
params.height = sizeInPx;
|
||||||
|
cardView.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < recyclerView.getChildCount(); i++) {
|
||||||
|
View cardViews = recyclerView.getChildAt(i);
|
||||||
|
if (cardViews instanceof CardView) {
|
||||||
|
// Adjust card padding
|
||||||
|
cardViews.setPadding( 0,0,0,0
|
||||||
|
);
|
||||||
|
|
||||||
|
// Find and resize the ImageView
|
||||||
|
ImageView imageView = cardView.findViewById(R.id.navImage);
|
||||||
|
if (imageView != null) {
|
||||||
|
ViewGroup.LayoutParams params = imageView.getLayoutParams();
|
||||||
|
params.width = 80;
|
||||||
|
params.height = 80;
|
||||||
|
imageView.setLayoutParams(params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ( model.contains("D20")) {
|
||||||
|
heightPx = 100; // ~80dp for D30/D20
|
||||||
|
paddingPx = 8 ;
|
||||||
|
} else if (model.contains("D30")) {
|
||||||
|
heightPx = 80;
|
||||||
|
// containerLayout.setVisibility(View.GONE);
|
||||||
|
footerContainer.setVisibility(View.GONE);
|
||||||
|
centerContainer.setVisibility(View.GONE);
|
||||||
|
paddingPx = 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
ViewGroup.LayoutParams params = logoImageView.getLayoutParams();
|
||||||
|
params.height = heightPx;
|
||||||
|
logoImageView.setLayoutParams(params);
|
||||||
|
containerLayout.setPadding(0, paddingPx, 0, paddingPx);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
Log.d(TAG, "Initializing ViewModel");
|
Log.d(TAG, "Initializing ViewModel");
|
||||||
|
|
||||||
|
@ -424,61 +521,74 @@ public class MulberryViewModel extends BaseAppViewModel {
|
||||||
JSONArray navItemsArray = new JSONArray(json);
|
JSONArray navItemsArray = new JSONArray(json);
|
||||||
List<NavItemViewModel> enabledItems = new ArrayList<>();
|
List<NavItemViewModel> enabledItems = new ArrayList<>();
|
||||||
|
|
||||||
|
// First pass: collect all enabled items with their original JSON data
|
||||||
for (int i = 0; i < navItemsArray.length(); i++) {
|
for (int i = 0; i < navItemsArray.length(); i++) {
|
||||||
JSONObject itemJson = navItemsArray.getJSONObject(i);
|
JSONObject itemJson = navItemsArray.getJSONObject(i);
|
||||||
|
|
||||||
// Use your exact existing model structure
|
|
||||||
NavItemViewModel item = new NavItemViewModel(
|
NavItemViewModel item = new NavItemViewModel(
|
||||||
itemJson.getString("navName"),
|
itemJson.getString("navName"),
|
||||||
parseIconSource(itemJson.opt("icon")),
|
parseIconSource(itemJson.opt("icon")),
|
||||||
itemJson.optInt("position", 0),
|
itemJson.optInt("position", 0),
|
||||||
itemJson.optBoolean("enabled", true) // Keep enabled status
|
itemJson.optBoolean("enabled", true),
|
||||||
|
itemJson // Store the original JSON to preserve page info
|
||||||
);
|
);
|
||||||
|
|
||||||
// Only add enabled items (matching your working version's behavior)
|
|
||||||
if (item.enabled) {
|
if (item.enabled) {
|
||||||
enabledItems.add(item);
|
enabledItems.add(item);
|
||||||
Log.d(TAG, "Loaded item: " + item.name +
|
Log.d(TAG, "Loaded item: " + item.name + " | Pos: " + item.position + " | Enabled: " + item.enabled);
|
||||||
" | Pos: " + item.position +
|
|
||||||
" | Enabled: " + item.enabled);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2. Sort with position logging (like your working version)
|
// Sort by position (same as working version)
|
||||||
Collections.sort(enabledItems, (i1, i2) -> {
|
Collections.sort(enabledItems, (i1, i2) -> {
|
||||||
Log.v(TAG, "Sorting: " + i1.position + " vs " + i2.position);
|
Log.v(TAG, "Sorting: " + i1.position + " vs " + i2.position);
|
||||||
return Integer.compare(i1.position, i2.position);
|
return Integer.compare(i1.position, i2.position);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3. Create ViewModels - optimized page ID handling
|
// Create ViewModels using the original JSON data for page mapping
|
||||||
for (int i = 0; i < enabledItems.size(); i++) {
|
for (NavItemViewModel item : enabledItems) {
|
||||||
JSONObject originalJson = navItemsArray.getJSONObject(i);
|
try {
|
||||||
NavItemViewModel item = enabledItems.get(i);
|
String pageName = item.originalJson.optString("navPage");
|
||||||
|
int pageId = PAGE_MAP.containsKey(pageName) ? PAGE_MAP.get(pageName) : NAV_HOME;
|
||||||
|
|
||||||
// Directly get page ID from the original JSON
|
navItems.add(new MulberryItemViewModel(
|
||||||
String pageName = originalJson.optString("navPage");
|
this,
|
||||||
int pageId = PAGE_MAP.containsKey(pageName)
|
item.name,
|
||||||
? PAGE_MAP.get(pageName)
|
item.iconSource,
|
||||||
: NAV_HOME;
|
pageId,
|
||||||
|
null
|
||||||
|
));
|
||||||
|
|
||||||
|
Log.d(TAG, "Added item: " + item.name + " | Page: " + pageName + " | PageID: " + pageId);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
navItems.add(new MulberryItemViewModel(
|
Log.e(TAG, "Error creating ViewModel for item: " + item.name, e);
|
||||||
this,
|
}
|
||||||
item.name,
|
|
||||||
item.iconSource,
|
|
||||||
pageId, // Maintain page structure
|
|
||||||
// null,
|
|
||||||
null
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d(TAG, "Loaded " + navItems.size() + " items from prefs");
|
Log.d(TAG, "Loaded " + navItems.size() + " items from prefs");
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "Error parsing nav items JSON", e);
|
Log.e(TAG, "Error parsing nav items JSON", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Updated model class to store original JSON
|
||||||
|
private static class NavItemViewModel {
|
||||||
|
String name;
|
||||||
|
Object iconSource;
|
||||||
|
int position;
|
||||||
|
boolean enabled;
|
||||||
|
JSONObject originalJson; // Store original JSON for page mapping
|
||||||
|
|
||||||
|
NavItemViewModel(String name, Object iconSource, int position, boolean enabled, JSONObject originalJson) {
|
||||||
|
this.name = name;
|
||||||
|
this.iconSource = iconSource;
|
||||||
|
this.position = position;
|
||||||
|
this.enabled = enabled;
|
||||||
|
this.originalJson = originalJson;
|
||||||
|
}
|
||||||
|
}
|
||||||
private Object parseIconSource(Object icon) {
|
private Object parseIconSource(Object icon) {
|
||||||
if (icon instanceof String) {
|
if (icon instanceof String) {
|
||||||
try {
|
try {
|
||||||
|
@ -492,20 +602,6 @@ public class MulberryViewModel extends BaseAppViewModel {
|
||||||
return icon; // Return as-is if not string
|
return icon; // Return as-is if not string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Simple model for navigation items
|
|
||||||
private static class NavItemViewModel {
|
|
||||||
String name;
|
|
||||||
Object iconSource;
|
|
||||||
int position;
|
|
||||||
boolean enabled;
|
|
||||||
|
|
||||||
NavItemViewModel(String name, Object iconSource, int position, boolean enabled) {
|
|
||||||
this.name = name;
|
|
||||||
this.iconSource = iconSource;
|
|
||||||
this.position = position;
|
|
||||||
this.enabled = enabled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCleared() {
|
protected void onCleared() {
|
||||||
|
|
|
@ -276,7 +276,7 @@ public class PosParameters {
|
||||||
map.put("scan", R.drawable.ax_scaner_grey);
|
map.put("scan", R.drawable.ax_scaner_grey);
|
||||||
map.put("printer", R.drawable.ax_receipt_grey);
|
map.put("printer", R.drawable.ax_receipt_grey);
|
||||||
map.put("settings", R.drawable.ax_settings_grey);
|
map.put("settings", R.drawable.ax_settings_grey);
|
||||||
map.put("pinpad", R.drawable.ax_menu_grey);
|
map.put("pinpad", R.drawable.ax_pinpad_grey);
|
||||||
map.put("cashier", R.drawable.ax_cashier_grey);
|
map.put("cashier", R.drawable.ax_cashier_grey);
|
||||||
map.put("mulberry", R.drawable.am_mulberry_logo_wide_color);
|
map.put("mulberry", R.drawable.am_mulberry_logo_wide_color);
|
||||||
map.put("overtec", R.drawable.am_overtec_logo_wide_color);
|
map.put("overtec", R.drawable.am_overtec_logo_wide_color);
|
||||||
|
|
|
@ -0,0 +1,179 @@
|
||||||
|
<vector xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android" android:height="250dp" android:viewportHeight="1024" android:viewportWidth="1024" android:width="250dp">
|
||||||
|
|
||||||
|
<path android:pathData="M263.9,96.4c-9.8,2.6 -17.1,8.9 -21.7,18.6 -1.6,3.2 -1.7,28 -1.7,340.5l0,337 3.4,6.3c3.7,6.8 8.3,11 15.8,14.5 4.5,2.1 6.3,2.2 32.1,2.5l27.2,0.3 0,35.3c0,37.9 0.3,40.2 5.6,50.8 3.8,7.4 12.5,16.1 20.4,20.2 13,6.9 4.8,6.6 167,6.6 159.5,-0 153.5,0.2 165.7,-5.7 7.2,-3.4 18.1,-14 21.5,-20.8 5.6,-10.9 5.8,-13 5.8,-51.1l0,-35.3 27.3,-0.3c26.9,-0.3 27.3,-0.3 32.8,-2.9 6.8,-3.2 12,-8.2 15.7,-15.2l2.7,-5.2 0,-337 0,-337 -3.4,-6.3c-3.7,-6.8 -8.3,-11 -15.8,-14.5l-4.8,-2.2 -245.5,-0.2c-192.4,-0.1 -246.5,0.1 -250.1,1.1zM753,455.5l0,329.5 -241,-0 -241,-0 0,-329.5 0,-329.5 241,-0 241,-0 0,329.5zM674.8,849.7c-0.3,38.4 -0.4,38.9 -8.7,44.8l-4.3,3 -149.8,-0 -149.8,-0 -4.3,-3c-8.3,-5.9 -8.4,-6.4 -8.7,-44.8l-0.3,-33.7 163.1,-0 163.1,-0 -0.3,33.7z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="240.5" android:endY="929" android:startX="240.5" android:startY="95.3" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M327.3,175c-2.5,1.1 -5.1,3.3 -6.3,5.2 -2,3.2 -2,4.8 -2,89.3 0,83.6 0.1,86.1 2,89.2 1,1.8 3.7,4.1 5.9,5.3 4,2 4.8,2 185.1,2 180.3,-0 181.1,-0 185.1,-2 2.2,-1.2 4.9,-3.5 5.9,-5.3 1.9,-3.1 2,-5.6 2,-89.2 0,-84.5 0,-86.1 -2,-89.3 -1.2,-1.9 -3.8,-4.1 -6.3,-5.2 -4.1,-1.9 -8.8,-2 -184.7,-2 -175.9,-0 -180.6,0.1 -184.7,2zM675,269.5l0,65.5 -163,-0 -163,-0 0,-65.5 0,-65.5 163,-0 163,-0 0,65.5z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="319" android:endY="366" android:startX="319" android:startY="173" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M347.3,429.5c-29.6,8.3 -44.1,40 -30.7,67.3 6.9,14.2 20.4,24 36.3,26.5 18.3,2.8 38.7,-7.3 48,-23.7 14.3,-25.2 2.5,-58.3 -24.6,-68.6 -7.5,-2.9 -21.6,-3.6 -29,-1.5zM366.9,460.5c7,3.5 11,12.3 9.1,19.5 -3.7,13.7 -20.2,17.5 -29.7,6.7 -7,-8 -4.5,-21.4 4.9,-26 4.1,-2.1 12,-2.2 15.7,-0.2z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="311.6" android:endY="523.8" android:startX="311.6" android:startY="428.3" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M500,429.4c-18.1,5.1 -32.1,20.6 -35.3,38.9 -5.3,31.3 23.2,60 54.5,54.8 18.9,-3.1 34.2,-16.9 39,-35 4.5,-17.4 -0.5,-34.6 -13.7,-47 -6.7,-6.2 -12.4,-9.5 -20.8,-11.7 -6.3,-1.7 -17.6,-1.7 -23.7,-0zM521,461.2c5.4,3.7 7.3,7.1 7.7,13.5 0.3,4.7 -0.1,6.6 -1.9,9.8 -2.7,4.7 -9.4,8.5 -14.8,8.5 -5.4,-0 -12.1,-3.8 -14.8,-8.5 -1.8,-3.2 -2.2,-5.1 -1.9,-9.8 0.6,-9.8 6.9,-15.7 16.7,-15.7 4.3,-0 6.5,0.6 9,2.2z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="464.1" android:endY="523.7" android:startX="464.1" android:startY="428.1" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M654.3,429.5c-25.4,6.9 -40.5,33.3 -33.7,59 5.5,21.3 27.8,37.1 49.6,35.1 41.9,-3.8 59.5,-54.3 28.9,-82.9 -11.5,-10.8 -29.5,-15.3 -44.8,-11.2zM675,460.9c9.6,5.1 11.8,17.9 4.4,26.1 -6.2,6.8 -15.9,7.9 -22.9,2.6 -10,-7.7 -9.1,-22 1.9,-28.7 4.1,-2.5 12,-2.5 16.6,-0z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="619" android:endY="523.8" android:startX="619" android:startY="428" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M350.1,537.1c-7.9,1.5 -18.4,7.3 -24.4,13.2 -19.4,19.5 -18.7,51 1.6,69.3 21.9,19.7 56.1,15.4 71.9,-9 10.1,-15.7 10.5,-36.5 0.9,-51.5 -10.9,-16.9 -31,-25.8 -50,-22zM366.6,568.6c13,6.2 13.1,24.3 0.2,31 -3.6,1.9 -11.2,1.8 -15.4,-0.2 -9.5,-4.5 -12.2,-18 -5.1,-26.1 5.4,-6.2 13.3,-8 20.3,-4.7z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="311.6" android:endY="632" android:startX="311.6" android:startY="536.2" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M502.5,537.2c-13.4,2.5 -27.2,13.2 -33.4,26 -12.3,25.1 -0.4,55.4 26,65.9 6.8,2.7 19.7,3.6 27,1.9 21.8,-5 38.1,-25.3 37.8,-47 -0.3,-29.9 -27.9,-52.5 -57.4,-46.8zM520.1,569.3c6.3,3.3 9.1,8.5 8.6,16 -0.6,9.8 -6.9,15.7 -16.7,15.7 -9.8,-0 -16.1,-5.9 -16.7,-15.7 -0.3,-4.7 0.1,-6.6 1.9,-9.7 2.7,-4.7 9.5,-8.6 14.8,-8.6 2,-0 5.7,1 8.1,2.3z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="464.2" android:endY="631.9" android:startX="464.2" android:startY="536.3" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M656.3,537.5c-17.2,3.9 -32.4,18.8 -36.2,35.6 -1.7,7.3 -1.3,18.1 0.9,25.3 4.2,13.3 15.7,25.7 28.7,30.6 7.3,2.8 20.1,3.7 27.4,2 24.4,-5.8 40.7,-29.4 36.9,-53.7 -1.3,-8.1 -6.3,-19.2 -11.4,-24.9 -10.8,-12.5 -30,-18.7 -46.3,-14.9zM673.3,568.4c4.4,1.8 9.5,7.8 10.3,12.1 1.4,7.5 -2.2,15.2 -8.6,18.6 -4.2,2.3 -12,2.5 -15.9,0.4 -4,-2 -7.9,-6.9 -9,-11.3 -3.5,-13.2 10.5,-25.2 23.2,-19.8z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="619" android:endY="631.9" android:startX="619" android:startY="536.4" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M344.8,646.9c-16.7,5.4 -30.3,21.4 -32.7,38.7 -4.5,31.3 22.4,58.6 53.4,54.3 12.1,-1.6 21.1,-6.4 29.4,-15.5 9.1,-9.9 12.6,-20.4 11.9,-34.9 -0.4,-8.1 -1,-10.4 -4,-16.7 -6.2,-12.8 -15.7,-21.4 -28.6,-25.7 -8,-2.7 -21.3,-2.8 -29.4,-0.2zM368.7,678.1c7.9,4.9 10.2,15.9 4.9,23.9 -3,4.5 -9,7.9 -14.1,8 -4.4,-0 -11.6,-4 -14.2,-7.9 -10.3,-15.4 7.6,-33.8 23.4,-24z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="311.6" android:endY="740.3" android:startX="311.6" android:startY="645" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M496.8,647.3c-23.9,8.2 -37,32 -31.3,56.6 4.4,18.6 20.7,33.3 39.8,36 37.4,5.2 66.1,-33.4 50.1,-67.6 -10.2,-21.7 -35.9,-32.7 -58.6,-25zM516.2,676c7.7,2.2 12.8,8.9 12.8,17 0,13.9 -17.2,21.9 -27.6,12.7 -4.5,-3.9 -6.4,-7.6 -6.4,-12.7 0,-7.8 4.3,-13.9 11.7,-16.5 4.7,-1.7 4.9,-1.7 9.5,-0.5z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="464.2" android:endY="740.4" android:startX="464.2" android:startY="644.8" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<path android:pathData="M653.5,646.4c-20.7,6.6 -34.5,25 -34.5,46 0.1,29.5 24.9,51.1 54.5,47.5 25.4,-3.1 44.6,-28.8 40.5,-54.3 -2.9,-18.4 -16.4,-33.9 -33.9,-39 -6.5,-1.9 -20.9,-2 -26.6,-0.2zM671.2,676c15.3,4.3 16.9,25.5 2.4,32.1 -5.2,2.3 -9,2.4 -14.2,-0 -10.6,-4.8 -13.1,-19.3 -4.7,-27.7 4.8,-4.8 10,-6.2 16.5,-4.4z" android:strokeColor="#00000000">
|
||||||
|
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
|
||||||
|
<gradient android:endX="619" android:endY="740.3" android:startX="619" android:startY="645.1" android:type="linear">
|
||||||
|
|
||||||
|
<item android:color="#FFACAFCA" android:offset="0"/>
|
||||||
|
|
||||||
|
<item android:color="#FF44454E" android:offset="1"/>
|
||||||
|
|
||||||
|
</gradient>
|
||||||
|
|
||||||
|
</aapt:attr>
|
||||||
|
|
||||||
|
</path>
|
||||||
|
|
||||||
|
</vector>
|
|
@ -5,6 +5,10 @@
|
||||||
xmlns:binding="http://schemas.android.com/apk/res-auto">
|
xmlns:binding="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="com.dspread.pos.ui.mulberry.MulberryFragment" />
|
||||||
|
|
||||||
<variable
|
<variable
|
||||||
name="viewModel"
|
name="viewModel"
|
||||||
type="com.dspread.pos.ui.mulberry.MulberryViewModel" />
|
type="com.dspread.pos.ui.mulberry.MulberryViewModel" />
|
||||||
|
@ -33,11 +37,18 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
|
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/gridLayout"
|
||||||
|
|
||||||
|
|
||||||
|
app:layout_constraintVertical_bias="0.5"
|
||||||
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent">
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivLogo"
|
android:id="@+id/ivLogo"
|
||||||
|
@ -55,12 +66,18 @@
|
||||||
android:id="@+id/gridLayout"
|
android:id="@+id/gridLayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
||||||
android:alignmentMode="alignMargins"
|
android:alignmentMode="alignMargins"
|
||||||
android:columnCount="2"
|
android:columnCount="2"
|
||||||
android:columnOrderPreserved="false"
|
android:columnOrderPreserved="false"
|
||||||
android:rowCount="2"
|
android:rowCount="2"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
|
||||||
|
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/centerContainer"
|
||||||
|
|
||||||
|
app:layout_constraintVertical_bias="0.5"
|
||||||
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/topLogoContainer"
|
app:layout_constraintTop_toBottomOf="@id/topLogoContainer"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
@ -102,7 +119,7 @@
|
||||||
android:id="@+id/card"
|
android:id="@+id/card"
|
||||||
android:layout_width="140dp"
|
android:layout_width="140dp"
|
||||||
android:layout_height="@dimen/main_grid_image_height_d30"
|
android:layout_height="@dimen/main_grid_image_height_d30"
|
||||||
android:scaleType="centerCrop"
|
android:scaleType="fitCenter"
|
||||||
android:src="@drawable/homo_card_black_box"
|
android:src="@drawable/homo_card_black_box"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/cardText"
|
app:layout_constraintBottom_toTopOf="@+id/cardText"
|
||||||
|
|
|
@ -22,10 +22,11 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="16dp">
|
android:padding="14dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="100dp"
|
android:id="@+id/navImage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="100dp"
|
android:layout_height="100dp"
|
||||||
android:src="@{viewModel.icon}"
|
android:src="@{viewModel.icon}"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
|
|
Loading…
Reference in New Issue