最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android實(shí)現(xiàn)購物車整體頁面邏輯詳解

 更新時間:2018年11月23日 11:46:23   作者:FanRQ_  
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)購物車的整體頁面邏輯,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文為大家講解了Android實(shí)現(xiàn)購物車的整體頁面邏輯,供大家參考,具體內(nèi)容如下

MainActivity.java

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

  String url = "http://www.zhaoapi.cn/product/getCarts";
  private ExpandableListView el_cart;
  private CheckBox cb_cart_all_select;
  private TextView tv_cart_total_price;
  private Button btn_cart_pay;
  MyAdapter adapter;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    initView();
    initData();
  }

  private void initData() {

    HashMap<String, String> map = new HashMap<>();
    map.put("uid","71");
    OkhtttpUtils.getInstance().doPost(url, map, new OkhtttpUtils.OkCallback() {
      @Override
      public void onFailure(Exception e) {

      }

      @Override
      public void onResponse(String json) {

        CartInfo cartInfo = new Gson().fromJson(json, CartInfo.class);
        if ("0".equals(cartInfo.getCode())){
          List<CartInfo.DataBean> data = cartInfo.getData();
          adapter = new MyAdapter(data);
          el_cart.setAdapter(adapter);

          //展開二級列表
          for(int x=0; x<data.size(); x++){
            el_cart.expandGroup(x);
          }

          adapter.setOnCartListChangeListener(new MyAdapter.onCartListChangeListener() {
            @Override
            public void onSellerCheckedChange(int i) {

              //商家被點(diǎn)擊
              boolean currentSellerAllProductSelected = adapter.isCurrentSellerAllProductSelected(i);
              adapter.changeCurrentSellerAllProductsStatus(i, !currentSellerAllProductSelected);
              adapter.notifyDataSetChanged();
              //B.刷新底部數(shù)據(jù)
              refreshSelectedAndTotalPriceAndTotalNumber();
            }

            @Override
            public void onProductCheckedChange(int i, int i1) {

              //點(diǎn)擊商品得checkbox
              adapter.changeCurrentProductStatus(i,i1);
              adapter.notifyDataSetChanged();
              //B.刷新底部數(shù)據(jù)
              refreshSelectedAndTotalPriceAndTotalNumber();
            }

            @Override
            public void onProducNumberChange(int i, int i1, int number) {

              //當(dāng)加減被點(diǎn)擊
              adapter.changeCurrentProductNumber(i,i1,number);
              adapter.notifyDataSetChanged();
              //B.刷新底部數(shù)據(jù)
              refreshSelectedAndTotalPriceAndTotalNumber();
            }
          });
        }
      }
    });
  }

  //B.刷新checkbox狀態(tài)和總價和總數(shù)量
  private void refreshSelectedAndTotalPriceAndTotalNumber() {
    //去判斷是否所有得商品都被選中
    boolean allProductsSelected = adapter.isAllProductsSelected();
    //設(shè)置給全選checkBox
    cb_cart_all_select.setChecked(allProductsSelected);

    //計算總價
    float totalPrice = adapter.calculateTotalPrice();
    tv_cart_total_price.setText("總價 " + totalPrice);

    //計算總數(shù)量
    int totalNumber = adapter.calculateTotalNumber();
    btn_cart_pay.setText("去結(jié)算(" + totalNumber + ")");
  }

  //初始化的操作
  private void initView() {
    el_cart = (ExpandableListView) findViewById(R.id.el_cart);
    cb_cart_all_select = (CheckBox) findViewById(R.id.cb_cart_all_select);
    tv_cart_total_price = (TextView) findViewById(R.id.tv_cart_total_price);
    btn_cart_pay = (Button) findViewById(R.id.btn_cart_pay);

    cb_cart_all_select.setOnClickListener(this);
  }

  @Override
  public void onClick(View view) {

    switch (view.getId()){
      case R.id.cb_cart_all_select:

        //底部全選按鈕
        //時候所有得商品都被選中
        boolean allProductsSelected = adapter.isAllProductsSelected();
        adapter.changeAllProductStatus(!allProductsSelected);
        adapter.notifyDataSetChanged();
        //刷新底部數(shù)據(jù)
        refreshSelectedAndTotalPriceAndTotalNumber();
        break;
    }
  }
}

MyAdapter.java

public class MyAdapter extends BaseExpandableListAdapter{

  private List<CartInfo.DataBean> list;
  public MyAdapter(List<CartInfo.DataBean> data) {
    list=data;
  }

  @Override
  public int getGroupCount() {
    return list==null ? 0 : list.size();
  }

  @Override
  public int getChildrenCount(int i) {
    return list.get(i).getList()==null ? 0 :list.get(i).getList().size();
  }

  @Override
  public View getGroupView(final int i, boolean b, View view, ViewGroup viewGroup) {

    //先拿到Bean里組的數(shù)據(jù),看hiJson
    CartInfo.DataBean dataBean = list.get(i);
    ParentViewHolder parentViewHolder;
    if (view == null) {
      view = View.inflate(viewGroup.getContext(), R.layout.item_cart_parent, null);
      parentViewHolder = new ParentViewHolder(view);
      view.setTag(parentViewHolder);
    } else {
      parentViewHolder = (ParentViewHolder) view.getTag();
    }
    parentViewHolder.seller_name_tv.setText(dataBean.getSellerName());

    boolean currentSellerAllProductSelected = isCurrentSellerAllProductSelected(i);
    parentViewHolder.seller_cb.setChecked(currentSellerAllProductSelected);

    //D.設(shè)置點(diǎn)擊CheckBox
    parentViewHolder.seller_cb.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mOnCartListChangeListener !=null){
          mOnCartListChangeListener.onSellerCheckedChange(i);
        }
      }
    });
    return view;
  }


  @Override
  public View getChildView(final int i, final int i1, boolean b, View view, ViewGroup viewGroup) {

    CartInfo.DataBean dataBean = list.get(i);
    List<CartInfo.DataBean.ListBean> list1 = dataBean.getList();
    CartInfo.DataBean.ListBean listBean = list1.get(i1);
    ChildViewHolder childViewHolder;


    if (view == null) {
      view = View.inflate(viewGroup.getContext(), R.layout.item_cart_child, null);
      childViewHolder = new ChildViewHolder(view);
      view.setTag(childViewHolder);
    } else {
      childViewHolder=(ChildViewHolder)view.getTag();
    }
    //設(shè)置商品名字
    childViewHolder.product_title_name_tv.setText(listBean.getTitle());
    //設(shè)置商品單價
    childViewHolder.product_price_tv.setText(listBean.getPrice()+"");
    //設(shè)置復(fù)選框是否選中
    childViewHolder.child_cb.setChecked(listBean.getSelected() == 1);

    //設(shè)置組合式自定義控件內(nèi)部的數(shù)量
    childViewHolder.add_remove_view.setNumber(listBean.getNum());

    //D.設(shè)置商品CheckBox的點(diǎn)擊事件,通過接口回調(diào),暴露給外面
    childViewHolder.child_cb.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View v) {
        if (mOnCartListChangeListener != null){
          mOnCartListChangeListener.onProductCheckedChange(i,i1);
        }
      }
    });

    //D.設(shè)置商品數(shù)量的點(diǎn)擊事件,通過接口回調(diào),暴露給外面
    childViewHolder.add_remove_view.setOnNumberChangeListener(new AddSubView.OnNumberChangeListener() {
      @Override
      public void onNumberChange(int num) {
        if (mOnCartListChangeListener !=null){
          mOnCartListChangeListener.onProducNumberChange(i,i1,num);
        }
      }
    });
    return view;
  }

  public boolean isCurrentSellerAllProductSelected(int i){//根據(jù)商品改變商家--如果商品全部選中商家則選中--有一個商品沒選中則商家不選中
    CartInfo.DataBean dataBean = list.get(i);
    List<CartInfo.DataBean.ListBean> beans = dataBean.getList();
    for (CartInfo.DataBean.ListBean bean : beans){

      if (bean.getSelected()==0){
        return false;
      }

    }
        return true;
  }

  public boolean isAllProductsSelected(){ //根據(jù)商品改變?nèi)x--如果商品全部選中全選則選中--有一個商品沒選中則全選不選中
    for (int x=0;x<list.size();x++){
      CartInfo.DataBean dataBean = list.get(x);
      List<CartInfo.DataBean.ListBean> list1 = dataBean.getList();
      for (int j=0;j<list1.size();j++){
        if (list1.get(j).getSelected()==0){
          return false;
        }
      }
    }
    return true;
  }

  public int calculateTotalNumber(){ //計算總數(shù)量
    int totalNumber=0;
    for (int i=0;i<list.size();i++){
      CartInfo.DataBean dataBean = list.get(i);
      List<CartInfo.DataBean.ListBean> list1 = dataBean.getList();
      for (int j=0;j<list1.size();j++){
        if (list1.get(j).getSelected()==1){
          int num = list1.get(j).getNum();

          totalNumber+=num;
        }
      }
    }

    return totalNumber;
  }


  public float calculateTotalPrice(){ //獲取總價
    float totalPrice=0;
    for (int i=0;i<list.size();i++){
      CartInfo.DataBean dataBean = list.get(i);
      List<CartInfo.DataBean.ListBean> list = dataBean.getList();
      for (int j=0;j<list.size();j++){
        if (list.get(j).getSelected()==1){
          float price = list.get(j).getPrice();
          int num = list.get(j).getNum();
          totalPrice+=price*num;
        }
      }
    }
    return totalPrice;
  }
  //C.當(dāng)商品組的全選框點(diǎn)擊時,更新所有商品的狀態(tài)
  public void changeCurrentSellerAllProductsStatus(int i,boolean isSelected){

    CartInfo.DataBean dataBean = list.get(i);
    List<CartInfo.DataBean.ListBean> beans = dataBean.getList();
    for (int j=0;j<beans.size();j++){
      CartInfo.DataBean.ListBean bean = beans.get(j);
      bean.setSelected(isSelected ?1 :0);
    }
  }

  //C.當(dāng)商家子條目的全選框選中時,更新其狀態(tài)
  public void changeCurrentProductStatus(int i , int i1){
    CartInfo.DataBean dataBean = list.get(i);
    List<CartInfo.DataBean.ListBean> list = dataBean.getList();
    CartInfo.DataBean.ListBean listBean = list.get(i1);
    listBean.setSelected(listBean.getSelected() == 0 ? 1 : 0 );

  }
  //C.設(shè)置所有商品的狀態(tài)
  public void changeAllProductStatus(boolean selected){
    for(int x=0; x<list.size() ; x++){
      CartInfo.DataBean dataBean = list.get(x);
      List<CartInfo.DataBean.ListBean> list = dataBean.getList();
      for(int j=0; j<list.size(); j++){
        list.get(j).setSelected(selected ? 1 : 0);
      }
    }
  }

  //C.當(dāng)加減器被點(diǎn)擊時,調(diào)用,改變里面當(dāng)前商品的數(shù)量 參數(shù)1定位那個商家  參數(shù)2定位哪個商品 參數(shù)3定位改變具體的數(shù)量是多少
  public void changeCurrentProductNumber(int i,int i1,int number){
    CartInfo.DataBean dataBean = list.get(i);
    List<CartInfo.DataBean.ListBean> list = dataBean.getList();
    CartInfo.DataBean.ListBean listBean = list.get(i1);
    listBean.setNum(number);
  }

  public interface onCartListChangeListener{
    /**
     * 當(dāng)商家的checkBox點(diǎn)擊時回調(diào)
     */
    void onSellerCheckedChange(int i);

    /**
     * 當(dāng)點(diǎn)擊子條目商品的CheckBox回調(diào)
     */
    void onProductCheckedChange(int i ,int i1);

    /**
     * 當(dāng)點(diǎn)擊加減按鈕的回調(diào)
     */
    void onProducNumberChange(int i , int i1 , int number);

  }
  //D.
  onCartListChangeListener mOnCartListChangeListener;
  //D.
  public void setOnCartListChangeListener(onCartListChangeListener onCartListChangeListener){
    mOnCartListChangeListener = onCartListChangeListener ;
  }

  public static class ParentViewHolder {
    public CheckBox seller_cb;
    public TextView seller_name_tv;

    public ParentViewHolder(View rootView) {
      this.seller_cb = (CheckBox) rootView.findViewById(R.id.seller_cb);
      this.seller_name_tv = (TextView) rootView.findViewById(R.id.seller_name_tv);
    }
  }

  public static class ChildViewHolder {
    public CheckBox child_cb;
    public ImageView product_icon_iv;
    public TextView product_title_name_tv;
    public TextView product_price_tv;
    public AddSubView add_remove_view;

    public ChildViewHolder(View rootView) {
      this.child_cb = (CheckBox) rootView.findViewById(R.id.child_cb);
      this.product_icon_iv = (ImageView) rootView.findViewById(R.id.product_icon_iv);
      this.product_title_name_tv = (TextView) rootView.findViewById(R.id.product_title_name_tv);
      this.product_price_tv = (TextView) rootView.findViewById(R.id.product_price_tv);
      this.add_remove_view = (AddSubView) rootView.findViewById(R.id.add_remove_view);
    }
  }

  @Override
  public Object getGroup(int i) {
    return null;
  }

  @Override
  public Object getChild(int i, int i1) {
    return null;
  }

  @Override
  public long getGroupId(int i) {
    return 0;
  }

  @Override
  public long getChildId(int i, int i1) {
    return 0;
  }

  @Override
  public boolean hasStableIds() {
    return false;
  }


  @Override
  public boolean isChildSelectable(int i, int i1) {
    return false;
  }
}

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent">

  <ExpandableListView
    android:id="@+id/el_cart"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="60dp" />

  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_alignParentBottom="true"
    android:background="#eeeeee"
    android:gravity="center_vertical">

    <CheckBox
      android:id="@+id/cb_cart_all_select"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" />

    <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="全選" />

    <TextView
      android:id="@+id/tv_cart_total_price"
      android:layout_width="0dp"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:paddingLeft="20dp"
      android:text="合計:¥0.00" />

    <Button
      android:id="@+id/btn_cart_pay"
      android:layout_width="100dp"
      android:layout_height="match_parent"
      android:text="去結(jié)算(0)" />
  </LinearLayout>

</RelativeLayout>

AddSubView.java

public class AddSubView extends LinearLayout implements View.OnClickListener{  //組合式控件
  private int number = 1;
  private TextView sub_tv;
  private TextView product_number_tv;
  private TextView add_tv;

  public AddSubView(Context context) {
    this(context,null);
  }

  public AddSubView(Context context, @Nullable AttributeSet attrs) {
    this(context, attrs,0);
  }

  public AddSubView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    View view = inflate(context, R.layout.add_remove, this);

    sub_tv=view.findViewById(R.id.sub_tv);
    product_number_tv=view.findViewById(R.id.product_number_tv);
    add_tv=view.findViewById(R.id.add_tv);


    sub_tv.setOnClickListener(this);
    add_tv.setOnClickListener(this);
  }

  @Override
  public void onClick(View view) {
    switch (view.getId()){

      case R.id.sub_tv:

        if (number>1){
          --number;
          product_number_tv.setText(number+"");
          if (onNumberChangeListener!=null){
            onNumberChangeListener.onNumberChange(number);
          }
        }else {
          Toast.makeText(getContext(), "不能再少了", Toast.LENGTH_SHORT).show();
        }
        break;

      case R.id.add_tv:

        if (number<8){
          ++number;
          product_number_tv.setText(number+"");
          if (onNumberChangeListener!=null){
            onNumberChangeListener.onNumberChange(number);
          }
        }else {
          Toast.makeText(getContext(), "不能再多了", Toast.LENGTH_SHORT).show();
        }
        break;
    }
  }

  public int getNumber() {
    return number;
  }

  public void setNumber(int number) {
    this.number = number;
    product_number_tv.setText(number + "");
  }

  OnNumberChangeListener onNumberChangeListener;

  public void setOnNumberChangeListener(OnNumberChangeListener onNumberChangeListener) {
    this.onNumberChangeListener = onNumberChangeListener;
  }

  interface OnNumberChangeListener {
    void onNumberChange(int num);
  }
}

add_remove.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:padding="2dp"
  android:layout_marginLeft="10dp"
  android:layout_width="60dp"
  android:layout_height="30dp"
  android:layout_gravity="center_vertical"
  android:background="#99000000"
  android:gravity="center_vertical">

  <TextView
    android:background="#ffffff"
    android:layout_weight="1"
    android:id="@+id/sub_tv"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:gravity="center"
    android:text="-"
    android:textSize="16sp" />

  <TextView
    android:text="1"
    android:layout_marginLeft="2dp"
    android:background="#ffffff"
    android:layout_weight="1"
    android:id="@+id/product_number_tv"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:gravity="center"
    />

  <TextView
    android:layout_marginLeft="2dp"
    android:background="#ffffff"
    android:layout_weight="1"
    android:id="@+id/add_tv"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:gravity="center"
    android:text="+"
    android:textSize="16sp" />

</LinearLayout>

item_cart_parent.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"   //商家條目
  android:layout_width="match_parent"
  android:layout_height="60dp"
  android:gravity="center_vertical"
  >


  <CheckBox
    android:id="@+id/seller_cb"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

  <TextView
    android:id="@+id/seller_name_tv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="20dp" />
</LinearLayout>

item_cart_child.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="120dp"
  android:gravity="center_vertical">

  <CheckBox
    android:id="@+id/child_cb"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

  <ImageView
    android:id="@+id/product_icon_iv"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_marginLeft="20dp"
    android:scaleType="centerCrop"
    android:src="@color/colorPrimary" />

  <LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:orientation="vertical">

    <TextView
      android:id="@+id/product_title_name_tv"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:ellipsize="end"
      android:maxLines="2"
      android:text="商品標(biāo)題" />

    <TextView
      android:id="@+id/product_price_tv"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="10dp"
      android:text="¥0.0" />
  </LinearLayout>

  <fanruiqi.bwie.com.shopcat.AddSubView
    android:id="@+id/add_remove_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginRight="10dp" />
</LinearLayout>

OkHttpUtils.java

public class OkhtttpUtils {
  private static OkhtttpUtils mOkhtttpUtils;
  private OkHttpClient mOkHttpClien;
  private final Handler mHandler;

  private OkhtttpUtils() {

    //創(chuàng)建一個主線程的handler
    mHandler = new Handler(Looper.getMainLooper());
    mOkHttpClien = new OkHttpClient.Builder()
        .connectTimeout(5000, TimeUnit.MILLISECONDS)
        .readTimeout(5000, TimeUnit.MILLISECONDS)
        .writeTimeout(5000, TimeUnit.MILLISECONDS)
        .build();
  }

  //單例模式
  public static OkhtttpUtils getInstance() {
    if (mOkhtttpUtils == null) {
      synchronized (OkhtttpUtils.class) {
        if (mOkhtttpUtils == null) {
          return mOkhtttpUtils = new OkhtttpUtils();
        }
      }
    }
    return mOkhtttpUtils;
  }

  public interface OkCallback {
    void onFailure(Exception e);
    void onResponse(String json);
  }


  public void doPost(String url, Map<String, String> map, final OkCallback okCallback) {
    //創(chuàng)建FormBody的對象,把表單添加到formBody中
    FormBody.Builder builder = new FormBody.Builder();
    if (map != null) {
      for (String key : map.keySet()) {
        builder.add(key, map.get(key));
      }
    }
    FormBody formBody = builder.build();

    //創(chuàng)建Request對象
    Request request = new Request.Builder()
        .post(formBody)
        .url(url)
        .build();
    //創(chuàng)建Call對象
    final Call call = mOkHttpClien.newCall(request);
    call.enqueue(new Callback() {
      @Override
      public void onFailure(Call call, final IOException e) {
        if (okCallback != null) {
          //切換到主線程
          mHandler.post(new Runnable() {
            @Override
            public void run() {
              okCallback.onFailure(e);
            }
          });
        }
      }
      @Override
      public void onResponse(Call call, final Response response) throws IOException {
        try {
          if (response != null && response.isSuccessful()) {
            final String json = response.body().string();
            mHandler.post(new Runnable() {
              @Override
              public void run() {
                if (okCallback != null) {
                  okCallback.onResponse(json);
                  return;
                }
              }
            });
          }
        } catch (IOException e) {
          e.printStackTrace();
        }
        if (okCallback != null) {
          okCallback.onFailure(new Exception("網(wǎng)絡(luò)異常"));
        }
      }
    });
  }




  //封裝doGet的網(wǎng)絡(luò)請求
  public void doGet(String url, final OkCallback okCallback) {
    Request request = new Request.Builder()
        .get()
        .url(url)
        .build();

    final Call call = mOkHttpClien.newCall(request);
    call.enqueue(new Callback() {
      @Override
      public void onFailure(Call call, final IOException e) {
        if (okCallback != null) {
          //切換到主線程
          mHandler.post(new Runnable() {
            @Override
            public void run() {
              okCallback.onFailure(e);
            }
          });
        }
      }

      @Override
      public void onResponse(Call call, final Response response) throws IOException {

        try {
          if (response != null && response.isSuccessful()) {
            final String json = response.body().string();
            mHandler.post(new Runnable() {
              @Override
              public void run() {
                if (okCallback != null) {
                  okCallback.onResponse(json);
                  return;
                }

              }
            });
          }
        } catch (IOException e) {
          e.printStackTrace();
        }

      }
    });
  }

}

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android性能優(yōu)化及性能優(yōu)化工具

    Android性能優(yōu)化及性能優(yōu)化工具

    這篇文章主要給大家分享的是Android性能優(yōu)化及性能優(yōu)化工具,下面文字會圍繞Android性能優(yōu)化的相關(guān)資料詳細(xì)的展開具體內(nèi)容,需要的朋友可以參考一下,希望對大家有所幫助
    2021-11-11
  • Kotlin server多線程編程詳細(xì)講解

    Kotlin server多線程編程詳細(xì)講解

    這篇文章主要介紹了Kotlin server多線程編程,Service是實(shí)現(xiàn)程序后臺運(yùn)行的解決方案,適合執(zhí)行非交互,后臺預(yù)先的任務(wù),即使用戶打開其他應(yīng)用,Service也能夠正常運(yùn)行
    2023-01-01
  • Android實(shí)現(xiàn)購物車功能

    Android實(shí)現(xiàn)購物車功能

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)購物車功能的具體方法 ,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-02-02
  • Android String資源文件插入值實(shí)例詳解

    Android String資源文件插入值實(shí)例詳解

    這篇文章主要介紹了Android String資源文件插入值實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下
    2017-06-06
  • Android游戲開發(fā):實(shí)現(xiàn)手勢操作切換圖片的實(shí)例

    Android游戲開發(fā):實(shí)現(xiàn)手勢操作切換圖片的實(shí)例

    本文主要介紹 Android游戲開發(fā)實(shí)現(xiàn)手勢操作切換圖片的實(shí)例,這里整理了詳細(xì)的資料和示例代碼,有開發(fā)Android游戲應(yīng)用的小伙伴可以參考下
    2016-08-08
  • Android圓角設(shè)置方法看著一篇文章就夠了

    Android圓角設(shè)置方法看著一篇文章就夠了

    我們在實(shí)際工作中,android經(jīng)常有需要實(shí)現(xiàn)圓角的場景,下面這篇文章主要給大家介紹了關(guān)于Android圓角設(shè)置方法的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì)需要的朋友可以參考下
    2023-02-02
  • Android實(shí)現(xiàn)簡單底部導(dǎo)航欄 Android仿微信滑動切換效果

    Android實(shí)現(xiàn)簡單底部導(dǎo)航欄 Android仿微信滑動切換效果

    這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)簡單底部導(dǎo)航欄,Android仿微信滑動切換效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2017-08-08
  • Kotlin創(chuàng)建一個好用的協(xié)程作用域

    Kotlin創(chuàng)建一個好用的協(xié)程作用域

    這篇文章主要介紹了Kotlin創(chuàng)建一個好用的協(xié)程作用域,kotlin中使用協(xié)程,是一定要跟協(xié)程作用域一起配合使用的,否則可能協(xié)程的生命周期無法被準(zhǔn)確控制,造成內(nèi)存泄漏或其他問題
    2022-07-07
  • Android應(yīng)用自動跳轉(zhuǎn)到應(yīng)用市場詳情頁面的方法

    Android應(yīng)用自動跳轉(zhuǎn)到應(yīng)用市場詳情頁面的方法

    最近在工作中遇到一個需求,推廣部門要求實(shí)現(xiàn)應(yīng)用自動跳轉(zhuǎn)到應(yīng)用市場詳情頁面,通過查找一些資料,實(shí)現(xiàn)出來了,覺得有必要整理下方便以后或者有需要的朋友們參考借鑒,下面來一起詳細(xì)看看Android應(yīng)用自動跳轉(zhuǎn)到應(yīng)用市場詳情頁面的方法吧。
    2016-12-12
  • Android Webview使用小結(jié)

    Android Webview使用小結(jié)

    這篇文章主要針對Android Webview的使用方法為大家進(jìn)行了詳細(xì)的總結(jié),感興趣的小伙伴們可以參考一下
    2016-06-06

最新評論

定边县| 昌平区| 彭泽县| 社旗县| 黔西县| 福泉市| 呼玛县| 金湖县| 奎屯市| 石阡县| 梅河口市| 长顺县| 登封市| 图们市| 石城县| 武功县| 岳阳县| 囊谦县| 固镇县| 安泽县| 屏边| 荔浦县| 盘锦市| 通河县| 从化市| 翁牛特旗| 万山特区| 临漳县| 皋兰县| 蓝田县| 肇州县| 苏尼特左旗| 禹城市| 贺兰县| 南华县| 安福县| 武穴市| 资阳市| 南江县| 石城县| 九龙县|