remove product from basket
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package ch.pizzalink.android.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.BottomNavigationView;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
@@ -12,6 +13,7 @@ import android.support.v7.widget.RecyclerView;
|
||||
import android.view.Gravity;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -79,12 +81,20 @@ public class MainActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void initViews(){
|
||||
initBadgeView();
|
||||
initNavigationDrawer();
|
||||
initBottomNavigationView();
|
||||
showStartScreen();
|
||||
setCartItemCount();
|
||||
}
|
||||
|
||||
private void initBadgeView(){
|
||||
badge = new QBadgeView(this)
|
||||
.setBadgeBackgroundColor(redColor)
|
||||
.setBadgeTextColor(whiteColor)
|
||||
.setBadgeGravity(Gravity.TOP | Gravity.END);
|
||||
}
|
||||
|
||||
private void showStartScreen(){
|
||||
fragmentManager = getSupportFragmentManager();
|
||||
if(isStartWithOrderHistory){
|
||||
@@ -306,16 +316,14 @@ public class MainActivity extends BaseActivity {
|
||||
addBadgeAt(1, SharedPrefsHelper.getCartItemCount());
|
||||
}
|
||||
|
||||
private void addBadgeAt(int position, int number) {
|
||||
// add badge
|
||||
badge = new QBadgeView(this)
|
||||
.setBadgeNumber(number)
|
||||
.setBadgeBackgroundColor(redColor)
|
||||
.setBadgeTextColor(whiteColor)
|
||||
.setBadgeGravity(Gravity.TOP | Gravity.END)
|
||||
.bindTarget(bottomNavigationView.getBottomNavigationItemView(position));
|
||||
|
||||
if(number == 0)
|
||||
badge.hide(true);
|
||||
public void reopenCartFragment(){
|
||||
currentFragmentName = "";
|
||||
bottomNavigationView.setCurrentItem(1);
|
||||
}
|
||||
|
||||
private void addBadgeAt(int position, int number) {
|
||||
badge.setBadgeNumber(number);
|
||||
badge.bindTarget(bottomNavigationView.getBottomNavigationItemView(position));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user