Prechádzať zdrojové kódy

红包页面的修改

jixionghui 4 rokov pred
rodič
commit
b9b65cd8c2

+ 15 - 0
jixin/src/main/java/com/jixin/im/fragment/BaseRedPacketFragment.java

@@ -0,0 +1,15 @@
+package com.jixin.im.fragment;
+
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.jixin.im.ui.base.EasyFragment;
+
+
+
+public abstract class BaseRedPacketFragment extends EasyFragment {
+    private int mRedPacketType;
+    EditText mEdtPacketMoney;
+    EditText mEdtRemark;
+    TextView mSendRedPacket;
+}

+ 17 - 0
jixin/src/main/java/com/jixin/im/fragment/NormalRedPacketFragment.java

@@ -0,0 +1,17 @@
+package com.jixin.im.fragment;
+
+import android.os.Bundle;
+
+import com.jixin.im.R;
+
+public class NormalRedPacketFragment extends BaseRedPacketFragment{
+    @Override
+    protected int inflateLayoutId() {
+        return R.layout.fragment_normal_sed_red_packet;
+    }
+
+    @Override
+    protected void onActivityCreated(Bundle savedInstanceState, boolean createView) {
+
+    }
+}

+ 15 - 0
jixin/src/main/java/com/jixin/im/fragment/PasswordRedPacketFragment.java

@@ -0,0 +1,15 @@
+package com.jixin.im.fragment;
+
+import android.os.Bundle;
+
+public class PasswordRedPacketFragment extends BaseRedPacketFragment {
+    @Override
+    protected int inflateLayoutId() {
+        return 0;
+    }
+
+    @Override
+    protected void onActivityCreated(Bundle savedInstanceState, boolean createView) {
+
+    }
+}

+ 69 - 238
jixin/src/main/java/com/jixin/im/ui/me/redpacket/SendRedPacketActivity.java

@@ -17,16 +17,22 @@ import android.widget.Button;
 import android.widget.EditText;
 import android.widget.TextView;
 
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
 import androidx.viewpager.widget.ViewPager;
 
+import com.google.android.material.tabs.TabLayout;
 import com.jixin.im.AppConstant;
 import com.jixin.im.R;
 import com.jixin.im.bean.message.ChatMessage;
 import com.jixin.im.bean.message.XmppMessage;
 import com.jixin.im.bean.redpacket.RedPacket;
+import com.jixin.im.db.InternationalizationHelper;
+import com.jixin.im.fragment.MucSendPacketFragment;
 import com.jixin.im.helper.DialogHelper;
 import com.jixin.im.helper.PaySecureHelper;
 import com.jixin.im.ui.base.BaseActivity;
+import com.jixin.im.ui.base.EasyFragment;
 import com.jixin.im.ui.message.ChatActivity;
 import com.jixin.im.ui.smarttab.SmartTabLayout;
 import com.jixin.im.util.Constants;
@@ -49,27 +55,23 @@ import okhttp3.Call;
 /**
  * Created by 魏正旺 on 2016/9/9.
  */
-public class SendRedPacketActivity extends BaseActivity implements View.OnClickListener {
-    LayoutInflater inflater;
-    private SmartTabLayout smartTabLayout;
+public class SendRedPacketActivity extends BaseActivity  {
+
+    private TabLayout mTabRedPacket;
     private ViewPager viewPager;
-    private List<View> views;
-    private List<String> mTitleList;
-    private EditText editTextPt;  // 普通红包的金额输入框
-    private EditText editTextKl;  // 口令红包的金额输入框
-    private EditText editTextPwd; // 口令输入框
-    private EditText editTextGre; // 祝福语输入框
+    private String roomId;
+
+
+    private List<EasyFragment> mFragmentList;
+    private TabFragmentPagerAdapter mPagerAdapter;
 
-    private String toUserId;
-    private int mCurrentItem;
 
     @Override
-    protected void onCreate(Bundle savedInstanceState) {
+    public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+
         setContentView(R.layout.activity_redpacket);
-        toUserId = getIntent().getStringExtra(AppConstant.EXTRA_USER_ID);
-        inflater = LayoutInflater.from(this);
-        initActionBar();
+        roomId = getIntent().getStringExtra("roomId");
         initView();
 
         checkHasPayPassword();
@@ -85,260 +87,89 @@ public class SendRedPacketActivity extends BaseActivity implements View.OnClickL
         }
     }
 
-    private void initActionBar() {
+    private void initView() {
         getSupportActionBar().hide();
-        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
-        findViewById(R.id.tv_title_left).setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                finish();
-            }
-        });
+        findViewById(R.id.mergerStatus).setBackgroundColor(getResources().getColor(R.color.transparent));
+        findViewById(R.id.iv_title_left).setOnClickListener(view -> finish());
         TextView tvTitle = (TextView) findViewById(R.id.tv_title_center);
-        tvTitle.setText(getString(R.string.chat_redpacket));
+        tvTitle.setText(InternationalizationHelper.getString("JX_SendGift"));
+        tvTitle.setTextColor(getResources().getColor(R.color.white));
+        mFragmentList = new ArrayList<>();
+        mTabRedPacket = findViewById(R.id.tab_red_packet);
+        viewPager =  findViewById(R.id.muc_viewpager);
+        initTabLayout();
+
     }
 
-    /**
-     * 初始化布局
-     */
-    private void initView() {
-        viewPager = (ViewPager) findViewById(R.id.viewpagert_redpacket);
-        smartTabLayout = (SmartTabLayout) findViewById(R.id.smarttablayout_redpacket);
-        views = new ArrayList<View>();
-        mTitleList = new ArrayList<String>();
-        mTitleList.add(getString(R.string.Usual_Gift));
-        mTitleList.add(getString(R.string.chat_kl_red));
-        View v1, v2;
-        v1 = inflater.inflate(R.layout.redpacket_pager_pt, null);
-        v2 = inflater.inflate(R.layout.redpacket_pager_kl, null);
-        views.add(v1);
-        views.add(v2);
-
-        // 获取EditText
-        editTextPt = (EditText) v1.findViewById(R.id.edit_money);
-        editTextGre = (EditText) v1.findViewById(R.id.edit_blessing);
-        editTextKl = (EditText) v2.findViewById(R.id.edit_money);
-        editTextPwd = (EditText) v2.findViewById(R.id.edit_password);
-        editTextPwd.addTextChangedListener(new TextWatcher() {
+    private void initFragment(){
+        MucSendPacketFragment luckFragment = new MucSendPacketFragment();
+        luckFragment.setRedPacketType(2);
+        luckFragment.setRoomId(roomId);
+        mFragmentList.add(luckFragment);
+        MucSendPacketFragment normalFragment = new MucSendPacketFragment();
+        normalFragment.setRedPacketType(1);
+        normalFragment.setRoomId(roomId);
+        mFragmentList.add(normalFragment);
+        mPagerAdapter = new TabFragmentPagerAdapter(getSupportFragmentManager(),mFragmentList);
+        viewPager.setAdapter(mPagerAdapter);
+        viewPager.setOffscreenPageLimit(mFragmentList.size());
+
+    }
+
+    private void initTabLayout(){
+        initFragment();
+
+        mTabRedPacket.setupWithViewPager(viewPager);
+        mTabRedPacket.removeAllTabs();
+//        TabLayout.Tab tab =  mTabRedPacket.newTab().setText("普通红包");
+
+        mTabRedPacket.addTab(  mTabRedPacket.newTab().setText(InternationalizationHelper.getString("JX_LuckGift")));//手气红包
+        mTabRedPacket.addTab(  mTabRedPacket.newTab().setText(InternationalizationHelper.getString("JX_UsualGift")));//普通红包
+        mTabRedPacket.setTabIndicatorFullWidth(false);
+        mTabRedPacket.setInlineLabel(true);
+        mTabRedPacket.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
             @Override
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+            public void onTabSelected(TabLayout.Tab tab) {
 
             }
 
             @Override
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
+            public void onTabUnselected(TabLayout.Tab tab) {
 
             }
 
             @Override
-            public void afterTextChanged(Editable s) {
-                String t = s.toString().trim();
-                if (s.length() != t.length()) {
-                    s.replace(0, s.length(), t);
-                }
+            public void onTabReselected(TabLayout.Tab tab) {
+
             }
         });
-        TextView tv_scan1 = v1.findViewById(R.id.tv_amount_of_money);
-        TextView tv_scan2 = v2.findViewById(R.id.tv_amount_of_money);
-
-        TextView jineTv, tipTv, sumjineTv, yuan1, yuan2;
-        jineTv = (TextView) v1.findViewById(R.id.JinETv);
-        tipTv = (TextView) v2.findViewById(R.id.textviewtishi);
-        sumjineTv = (TextView) v2.findViewById(R.id.sumMoneyTv);
-        yuan1 = (TextView) v1.findViewById(R.id.yuanTv);
-        yuan2 = (TextView) v2.findViewById(R.id.yuanTv);
-        jineTv.setText(getString(R.string.hint_money));
-        tipTv.setText(getString(R.string.hint_red_packet_key));
-        sumjineTv.setText(getString(R.string.total_money));
-        yuan1.setText(getString(R.string.yuan));
-        yuan2.setText(getString(R.string.yuan));
-
-        editTextPt.setHint(R.string.input_gift_count);
-        editTextGre.setHint(getString(R.string.auspicious));
-
-        editTextKl.setHint(R.string.input_gift_count);
-        editTextPwd.setHint(getString(R.string.want_open_gift));
-
-        TextView koulinTv;
-        koulinTv = (TextView) v2.findViewById(R.id.setKouLinTv);
-        koulinTv.setText(getString(R.string.message_red_new));
-
-        Button b1 = (Button) v1.findViewById(R.id.btn_sendRed);
-        b1.setAlpha(0.6f);
-        b1.setOnClickListener(this);
-        Button b2 = (Button) v2.findViewById(R.id.btn_sendRed);
-        b2.setAlpha(0.6f);
-        b2.setOnClickListener(this);
-
-        b1.requestFocus();
-        b1.setClickable(true);
-        b2.requestFocus();
-        b2.setClickable(true);
-
-        InputChangeListener inputChangeListenerPt = new InputChangeListener(editTextPt, tv_scan1, b1);
-        InputChangeListener inputChangeListenerKl = new InputChangeListener(editTextKl, tv_scan2, b2);
-
-        editTextPt.addTextChangedListener(inputChangeListenerPt);
-        editTextKl.addTextChangedListener(inputChangeListenerKl);
-
-        //设置值允许输入数字和小数点
-        editTextPt.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
-        editTextKl.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
-
-        viewPager.setAdapter(new PagerAdapter());
-        inflater = LayoutInflater.from(this);
-        smartTabLayout.setViewPager(viewPager);
-
-        /**
-         * 为了实现点击Tab栏切换的时候不出现动画
-         * 为每个Tab重新设置点击事件
-         */
-        for (int i = 0; i < mTitleList.size(); i++) {
-            View view = smartTabLayout.getTabAt(i);
-            view.setTag(i + "");
-            view.setOnClickListener(this);
-        }
-    }
 
-    @Override
-    public void onClick(View v) {
-        if (v.getId() == R.id.btn_sendRed) {
-            final Bundle bundle = new Bundle();
-            final Intent data = new Intent(this, ChatActivity.class);
-            String money = null, words = null;
-
-            //根据Tab的Item来判断当前发送的是那种红包
-            final int item = viewPager.getCurrentItem();
-
-            //获取金额和文字信息(口令或者祝福语)
-            if (item == 0) {
-                money = editTextPt.getText().toString();
-                words = editTextGre.getText().toString();
-                if (TextUtils.isEmpty(words)) {
-                    words = editTextGre.getHint().toString();
-                }
-            } else if (item == 1) {
-                money = editTextKl.getText().toString();
-                words = editTextPwd.getText().toString();
-                if (TextUtils.isEmpty(words)) {
-                    words = editTextPwd.getHint().toString();
-                    words = words.substring(1, words.length());
-                }
-            }
-            if (TextUtils.isEmpty(money)) {
-                ToastUtil.showToast(mContext, getString(R.string.input_gift_count));
-            } else if (Double.parseDouble(money) > 500 || Double.parseDouble(money) <= 0) {
-                ToastUtil.showToast(mContext, getString(R.string.recharge_money_count));
-            } else {
-                money = Money.fromYuan(money);
-                final String finalMoney = money;
-                final String finalWords = words;
-                PaySecureHelper.inputPayPassword(this, getString(R.string.chat_redpacket), money, password -> {
-                    sendRed(item == 0 ? "1" : "3", finalMoney, String.valueOf(1), finalWords, password);
-                });
-            }
-        } else {
-            // 根据Tab按钮传递的Tag来判断是那个页面,设置到相应的界面并且去掉动画
-            int index = Integer.parseInt(v.getTag().toString());
-            if (mCurrentItem != index) {
-                mCurrentItem = index;
-                hideKeyboard();
-            }
-            viewPager.setCurrentItem(index, false);
-        }
     }
 
-    private void hideKeyboard() {
-        InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
-        if (imm != null && imm.isActive() && this.getCurrentFocus() != null) {
-            if (this.getCurrentFocus().getWindowToken() != null) {
-                imm.hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
-            }
-        }
-    }
 
-    public void sendRed(final String type, String pMoney, String count, final String words, String payPassword) {
-        if (!coreManager.isLogin()) {
-            return;
-        }
-        DialogHelper.showDefaulteMessageProgressDialog(mContext);
-
-        String money = Money.fromYuan(pMoney);
-        Map<String, String> params = new HashMap<>();
-        params.put("type", type);
-        params.put("moneyStr", money);
-        params.put("count", count);
-        params.put("greetings", words);
-        params.put("toUserId", toUserId);
-        PaySecureHelper.generateParam(
-                mContext, payPassword, params,
-                "" + type + money + count + words + toUserId,
-                t -> {
-                    DialogHelper.dismissProgressDialog();
-                    ToastUtil.showToast(mContext, mContext.getString(R.string.tip_pay_secure_place_holder, t.getMessage()));
-                }, (p, code) -> {
-                    HttpUtils.get().url(coreManager.getConfig().REDPACKET_SEND)
-                            .params(p)
-                            .build()
-                            .execute(new BaseCallback<RedPacket>(RedPacket.class) {
-
-                                @Override
-                                public void onResponse(ObjectResult<RedPacket> result) {
-                                    DialogHelper.dismissProgressDialog();
-                                    if (Result.checkSuccess(mContext, result)) {
-                                        RedPacket redPacket = result.getData();
-                                        String objectId = redPacket.getId();
-                                        ChatMessage message = new ChatMessage();
-                                        message.setType(XmppMessage.TYPE_RED);
-                                        message.setFromUserId(coreManager.getSelf().getUserId());
-                                        message.setFromUserName(coreManager.getSelf().getNickName());
-                                        message.setContent(words); // 祝福语
-                                        message.setFilePath(type); // 用FilePath来储存红包类型
-                                        message.setFileSize(redPacket.getStatus()); //用filesize来储存红包状态
-                                        message.setObjectId(objectId); // 红包id
-                                        Intent intent = new Intent();
-                                        intent.putExtra(AppConstant.EXTRA_CHAT_MESSAGE, message.toJsonString());
-                                        setResult(viewPager.getCurrentItem() == 0 ? ChatActivity.REQUEST_CODE_SEND_RED_PT : ChatActivity.REQUEST_CODE_SEND_RED_KL, intent);
-                                        finish();
-                                    }
-                                }
-
-                                @Override
-                                public void onError(Call call, Exception e) {
-                                    DialogHelper.dismissProgressDialog();
-                                }
-                            });
-                }
-        );
-    }
 
-    private class PagerAdapter extends androidx.viewpager.widget.PagerAdapter {
+    private class TabFragmentPagerAdapter extends FragmentPagerAdapter {
 
-        @Override
-        public int getCount() {
-            return views.size();
+        private List<EasyFragment> mFragmentList;
+        public TabFragmentPagerAdapter(FragmentManager fm, List<EasyFragment> list) {
+            super(fm);
+            this.mFragmentList = list;
         }
 
         @Override
-        public boolean isViewFromObject(View view, Object object) {
-            return view == object;
+        public void setPrimaryItem(ViewGroup container, int position, Object object) {
+            super.setPrimaryItem(container, position, object);
         }
 
         @Override
-        public Object instantiateItem(View container, int position) {
-            ((ViewGroup) container).addView(views.get(position));
-            return views.get(position);
+        public EasyFragment getItem(int position) {
+            return mFragmentList.get(position);//显示第几个页面
         }
 
         @Override
-        public Parcelable saveState() {
-            return null;
+        public int getCount() {
+            return mFragmentList.size();//有几个页面
         }
 
-        @Override
-        public CharSequence getPageTitle(int position) {
-
-            return mTitleList.get(position);
-        }
     }
 }

+ 17 - 0
jixin/src/main/res/drawable/selector_send_red_packet_tab_item_bg.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true">
+        <layer-list>
+            <item android:bottom="4dp" android:top="4dp" android:left="12dp" android:right="12dp">
+                <shape >
+                    <corners android:radius="16dp"/>
+                    <solid android:color="@color/white"/>
+                </shape>
+
+            </item>
+        </layer-list>
+
+    </item>
+
+    <item android:drawable="@color/transparent" android:state_selected="false"/>
+</selector>

+ 5 - 2
jixin/src/main/res/drawable/shape_send_red_packet.xml

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
-    <corners android:radius="6dp"/>
-    <solid android:color="#1aa8ff"/>
+    <corners android:radius="25dp"/>
+    <gradient android:startColor="#FF3D25"
+        android:type="linear"
+        android:angle="0"
+        android:endColor="#FF452F"/>
 
 </shape>

+ 4 - 5
jixin/src/main/res/layout/activity_muc_redpacket.xml

@@ -16,13 +16,12 @@
             android:id="@+id/tab_red_packet"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:tabIndicatorColor="@color/redpacket_bg_new"
+            app:tabIndicatorColor="@color/transparent"
             app:tabMode="fixed"
-            app:tabBackground="@color/redpacket_bg_new"
-
+            app:tabBackground="@color/transparent"
             app:tabRippleColor="@android:color/transparent"
-            app:tabSelectedTextColor="@color/white"
-            app:tabTextColor="@color/replay_text_color_normal" />
+            app:tabSelectedTextColor="#FF462F"
+            app:tabTextColor="@color/white" />
 
         <androidx.viewpager.widget.ViewPager
             android:id="@+id/muc_viewpager"

+ 38 - 64
jixin/src/main/res/layout/activity_redpacket.xml

@@ -1,76 +1,50 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
-
-    <FrameLayout
+    <ImageView
         android:layout_width="match_parent"
-        android:layout_height="70dp"
-        android:background="@color/redpacket_bg_new">
-
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:layout_marginTop="20dp">
-
-            <ImageView
-                android:id="@+id/tv_title_left"
-                android:layout_width="wrap_content"
-                android:layout_height="match_parent"
-                android:layout_marginLeft="15dp"
-                android:gravity="center"
-                android:src="@mipmap/return_icon"
-                android:tint="@color/white" />
-
-            <TextView
-                android:id="@+id/tv_title_center"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerInParent="true"
-                android:layout_marginLeft="10dp"
-                android:text="@string/send_red_packet"
-                android:textColor="@color/white"
-                android:textSize="18sp" />
+        android:scaleType="fitXY"
+        android:src="@mipmap/red_packet_send_top_bg_"
+        android:layout_height="250dp"/>
+    <include layout="@layout/a_view_actionbar"
+        android:layout_width="match_parent"
+        android:layout_height="72dp"
+        />
 
-        </RelativeLayout>
 
-    </FrameLayout>
 
-    <com.jixin.im.ui.smarttab.SmartTabLayout
-        android:id="@+id/smarttablayout_redpacket"
+    <RelativeLayout
+        android:layout_marginTop="72dp"
         android:layout_width="match_parent"
-        android:layout_height="40dp"
-        android:background="@color/redpacket_bg_new"
-        app:stl_customTabTextLayoutId="@layout/a_custom_tab"
-        app:stl_defaultTabTextAllCaps="true"
-        app:stl_defaultTabTextColor="@color/replay_text_color_normal"
-        app:stl_defaultTabTextHorizontalPadding="10dp"
-        app:stl_defaultTabTextMinWidth="0dp"
-        app:stl_defaultTabTextSize="@dimen/redpacket_text_size_tab"
-        app:stl_distributeEvenly="true"
-        app:stl_dividerColor="#00000000"
-        app:stl_dividerThickness="1dp"
-        app:stl_drawDecorationAfterTab="false"
-        app:stl_indicatorAlwaysInCenter="false"
-        app:stl_indicatorColor="@color/transparent"
-        app:stl_indicatorCornerRadius="2dp"
-        app:stl_indicatorGravity="bottom"
-        app:stl_indicatorInFront="false"
-        app:stl_indicatorInterpolation="linear"
-        app:stl_indicatorThickness="1dp"
-        app:stl_indicatorWithoutPadding="true"
-        app:stl_overlineColor="#ffffff"
-        app:stl_overlineThickness="0dp"
-        app:stl_titleOffset="24dp"
-        app:stl_underlineColor="#ffffff"
-        app:stl_underlineThickness="0dp" />
+        android:layout_height="match_parent">
 
-    <androidx.viewpager.widget.ViewPager
-        android:id="@+id/viewpagert_redpacket"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_below="@+id/smarttablayout_redpacket" />
+        <com.google.android.material.tabs.TabLayout
+            android:id="@+id/tab_red_packet"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:tabIndicatorColor="@color/transparent"
+            app:tabMode="fixed"
+            app:tabBackground="@drawable/selector_send_red_packet_tab_item_bg"
+            app:tabRippleColor="@color/transparent"
+            app:tabSelectedTextColor="#FF462F"
+            app:tabTextColor="@color/white" />
+
+        <androidx.viewpager.widget.ViewPager
+            android:id="@+id/muc_viewpager"
+            android:layout_marginTop="40dp"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:overScrollMode="never"
+            android:layout_below="@+id/tab_red_packet">
+            <FrameLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:id="@+id/fragment_content"/>
+        </androidx.viewpager.widget.ViewPager>
+
+    </RelativeLayout>
 
-</LinearLayout>
+</FrameLayout>

+ 1 - 1
jixin/src/main/res/layout/activity_sharefriends.xml

@@ -1,8 +1,8 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@mipmap/bg_share"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical">
 
     <include layout="@layout/a_view_actionbar" />

+ 0 - 45
jixin/src/main/res/layout/chat_from_item_redpacket.xml

@@ -35,51 +35,6 @@
         android:textSize="@dimen/SmallerTextSize"
         android:visibility="gone" />
 
-    <!-- <RelativeLayout
-         android:id="@+id/chat_warp_view"
-         android:layout_width="@dimen/chat_width_red"
-         android:layout_height="64dp"
-         android:layout_below="@id/nick_name"
-         android:layout_marginTop="@dimen/chat_head_top"
-         android:layout_toLeftOf="@id/chat_head_iv"
-         android:background="@drawable/a_bg_for_chat_red1">
-
-         <ImageView
-             android:id="@+id/iv_image"
-             android:layout_width="30dp"
-             android:layout_height="30dp"
-             android:layout_centerVertical="true"
-             android:layout_marginLeft="8dp"
-             android:layout_marginTop="20dp"
-             android:src="@drawable/ic_chat_hongbao" />
-
-         <TextView
-             android:id="@+id/chat_text"
-             android:layout_width="wrap_content"
-             android:layout_height="wrap_content"
-             android:layout_centerVertical="true"
-             android:layout_marginLeft="8dp"
-             android:layout_toRightOf="@id/iv_image"
-             android:maxLines="1"
-             android:maxWidth="140dp"
-             android:text="@string/best_wishes"
-             android:textColor="@color/white"
-             android:textSize="@dimen/chat_text_size" />
-
-     </RelativeLayout>
-
-     <TextView
-         android:id="@+id/tv_type"
-         android:layout_width="@dimen/chat_width_red"
-         android:layout_height="22dp"
-         android:layout_below="@id/chat_warp_view"
-         android:layout_toLeftOf="@id/chat_head_iv"
-         android:background="@drawable/a_bg_for_chat_red2"
-         android:gravity="center_vertical"
-         android:paddingLeft="12dp"
-         android:text="@string/chat_red"
-         android:textColor="@color/Grey_500"
-         android:textSize="11sp" />-->
     <RelativeLayout
         android:id="@+id/chat_warp_view"
         android:layout_width="@dimen/chat_width_red"

+ 170 - 0
jixin/src/main/res/layout/fragment_normal_sed_red_packet.xml

@@ -0,0 +1,170 @@
+<?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"
+    android:padding="15dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@mipmap/rad_packet_fragment_bg"
+        android:orientation="vertical"
+        android:padding="32dp">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/tv_amount"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_money"
+                android:layout_alignParentStart="true"
+                android:text="金额"
+                android:layout_marginBottom="3dp"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+
+            <EditText
+                android:id="@+id/edt_input_money"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="2dp"
+                android:layout_marginEnd="2dp"
+                android:layout_toLeftOf="@+id/tv_yuan"
+                android:layout_toRightOf="@+id/tv_amount"
+                android:background="@color/transparent"
+                android:gravity="center_vertical|end"
+                android:hint="0.01"
+                android:inputType="numberDecimal"
+
+                android:textColor="#ff462f"
+                android:textColorHint="#999999"
+                android:textSize="24dp" />
+
+            <TextView
+                android:id="@+id/tv_yuan"
+                android:layout_width="wrap_content"
+                android:layout_marginBottom="3dp"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_money"
+                android:layout_alignParentEnd="true"
+                android:text="元"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="16dp"
+            android:background="#dddddd" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="40dp">
+
+            <TextView
+                android:layout_marginBottom="3dp"
+                android:id="@+id/tv_red_packet_num"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edit_red_packet_count"
+                android:layout_alignParentStart="true"
+                android:text="红包个数"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+
+            <EditText
+                android:id="@+id/edit_red_packet_count"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="2dp"
+                android:layout_marginEnd="2dp"
+                android:layout_toStartOf="@+id/tv_individual"
+                android:layout_toEndOf="@+id/tv_red_packet_num"
+                android:background="@color/transparent"
+                android:gravity="center_vertical|end"
+                android:hint="0.01"
+                android:inputType="numberDecimal"
+
+                android:textColor="#ff462f"
+                android:textColorHint="#999999"
+                android:textSize="24sp" />
+
+            <TextView
+                android:id="@+id/tv_individual"
+                android:layout_width="wrap_content"
+                android:layout_marginBottom="3dp"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edit_red_packet_count"
+                android:layout_alignParentEnd="true"
+                android:text="个"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="16dp"
+            android:background="#dddddd" />
+
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="60dp">
+
+            <TextView
+                android:id="@+id/tv_remark"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_remark"
+                android:layout_alignParentStart="true"
+                android:hint="0.01"
+                android:text="备注:"
+                android:textColor="#333333"
+                android:textColorHint="#999999"
+                android:textSize="@dimen/sp_14_text_size" />
+
+            <EditText
+                android:id="@+id/edt_input_remark"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="2dp"
+                android:layout_toRightOf="@+id/tv_remark"
+                android:background="@color/transparent"
+                android:gravity="center_vertical|end"
+                android:hint="恭喜发财,大吉大利!"
+                android:singleLine="true"
+                android:textColor="#333333"
+                android:textSize="18dp" />
+
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="16dp"
+            android:background="#dddddd" />
+
+        <TextView
+            android:id="@+id/tv_send_red_packet"
+            android:layout_width="286dp"
+            android:layout_height="50dp"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="85dp"
+            android:layout_marginBottom="35dp"
+            android:background="@drawable/shape_send_red_packet"
+            android:gravity="center"
+            android:text="发送群红包"
+            android:textColor="@color/white"
+            android:textSize="18sp" />
+
+    </LinearLayout>
+
+</FrameLayout>

+ 126 - 0
jixin/src/main/res/layout/fragment_password_red_packet.xml

@@ -0,0 +1,126 @@
+<?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"
+    android:padding="15dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@mipmap/rad_packet_fragment_bg"
+        android:orientation="vertical"
+        android:padding="32dp">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/tv_amount"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_money"
+                android:layout_alignParentStart="true"
+                android:text="金额"
+                android:layout_marginBottom="3dp"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+
+            <EditText
+                android:id="@+id/edt_input_money"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="2dp"
+                android:layout_marginEnd="2dp"
+                android:layout_toLeftOf="@+id/tv_yuan"
+                android:layout_toRightOf="@+id/tv_amount"
+                android:background="@color/transparent"
+                android:gravity="center_vertical|end"
+                android:hint="0.01"
+                android:inputType="numberDecimal"
+
+                android:textColor="#ff462f"
+                android:textColorHint="#999999"
+                android:textSize="24dp" />
+
+            <TextView
+                android:id="@+id/tv_yuan"
+                android:layout_width="wrap_content"
+                android:layout_marginBottom="3dp"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_money"
+                android:layout_alignParentEnd="true"
+                android:text="元"
+                android:textColor="#333333"
+                android:textSize="@dimen/sp_14_text_size" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="16dp"
+            android:background="#dddddd" />
+        <ViewStub
+            android:id="@+id/view_stub_red_packet_count"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+
+
+
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="36dp">
+
+            <TextView
+                android:id="@+id/tv_remark"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_alignBottom="@+id/edt_input_remark"
+                android:layout_alignParentStart="true"
+                android:hint="0.01"
+                android:text="备注:"
+                android:layout_marginBottom="3dp"
+                android:textColor="#333333"
+                android:textColorHint="#999999"
+                android:textSize="@dimen/sp_14_text_size" />
+
+            <EditText
+                android:id="@+id/edt_input_remark"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+
+                android:layout_marginStart="2dp"
+                android:layout_toRightOf="@+id/tv_remark"
+                android:background="@color/transparent"
+                android:gravity="center_vertical|end"
+                android:hint="恭喜发财,大吉大利!"
+                android:singleLine="true"
+                android:textColor="#333333"
+                android:textSize="18dp" />
+
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1px"
+            android:layout_marginTop="16dp"
+            android:background="#dddddd" />
+
+        <TextView
+            android:id="@+id/tv_send_red_packet"
+            android:layout_width="286dp"
+            android:layout_height="50dp"
+            android:layout_gravity="center_horizontal"
+            android:layout_marginTop="85dp"
+            android:layout_marginBottom="35dp"
+            android:background="@drawable/shape_send_red_packet"
+            android:gravity="center"
+            android:text="发送群红包"
+            android:textColor="@color/white"
+            android:textSize="18sp" />
+
+    </LinearLayout>
+
+</FrameLayout>

+ 44 - 0
jixin/src/main/res/layout/view_stub_exclusive_red_packet_part.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:orientation="vertical"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="36dp">
+
+        <TextView
+            android:id="@+id/tv_remark"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignBottom="@+id/edt_input_remark"
+            android:layout_alignParentStart="true"
+            android:text="专属:"
+            android:layout_marginBottom="3dp"
+            android:textColor="#333333"
+            android:textColorHint="#999999"
+            android:textSize="@dimen/sp_14_text_size" />
+
+        <EditText
+            android:id="@+id/edt_input_red_packet_pwd"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="2dp"
+            android:layout_toRightOf="@+id/tv_remark"
+            android:background="@color/transparent"
+            android:gravity="center_vertical|end"
+            android:hint="恭喜发财,大吉大利!"
+            android:singleLine="true"
+            android:textColor="#333333"
+            android:textSize="18dp" />
+
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_marginTop="16dp"
+        android:background="#dddddd" />
+</LinearLayout>

+ 44 - 0
jixin/src/main/res/layout/view_stub_pwd_red_packet_part.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:orientation="vertical"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="36dp">
+
+        <TextView
+            android:id="@+id/tv_remark"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignBottom="@+id/edt_input_remark"
+            android:layout_alignParentStart="true"
+            android:text="口令:"
+            android:layout_marginBottom="3dp"
+            android:textColor="#333333"
+            android:textColorHint="#999999"
+            android:textSize="@dimen/sp_14_text_size" />
+
+        <EditText
+            android:id="@+id/edt_input_red_packet_pwd"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="2dp"
+            android:layout_toRightOf="@+id/tv_remark"
+            android:background="@color/transparent"
+            android:gravity="center_vertical|end"
+            android:hint="恭喜发财,大吉大利!"
+            android:singleLine="true"
+            android:textColor="#333333"
+            android:textSize="18dp" />
+
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_marginTop="16dp"
+        android:background="#dddddd" />
+</LinearLayout>

+ 56 - 0
jixin/src/main/res/layout/view_stub_red_packet_count_part.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:orientation="vertical"
+    android:layout_height="wrap_content">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="40dp">
+
+        <TextView
+            android:layout_marginBottom="3dp"
+            android:id="@+id/tv_red_packet_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignBottom="@+id/edit_red_packet_count"
+            android:layout_alignParentStart="true"
+            android:text="红包个数"
+            android:textColor="#333333"
+            android:textSize="@dimen/sp_14_text_size" />
+
+        <EditText
+            android:id="@+id/edit_red_packet_count"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="2dp"
+            android:layout_marginEnd="2dp"
+            android:layout_toStartOf="@+id/tv_individual"
+            android:layout_toEndOf="@+id/tv_red_packet_num"
+            android:background="@color/transparent"
+            android:gravity="center_vertical|end"
+            android:hint="0.01"
+            android:inputType="numberDecimal"
+
+            android:textColor="#ff462f"
+            android:textColorHint="#999999"
+            android:textSize="24sp" />
+
+        <TextView
+            android:id="@+id/tv_individual"
+            android:layout_width="wrap_content"
+            android:layout_marginBottom="3dp"
+            android:layout_height="wrap_content"
+            android:layout_alignBottom="@+id/edit_red_packet_count"
+            android:layout_alignParentEnd="true"
+            android:text="个"
+            android:textColor="#333333"
+            android:textSize="@dimen/sp_14_text_size" />
+    </RelativeLayout>
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1px"
+        android:layout_marginTop="16dp"
+        android:background="#dddddd" />
+</LinearLayout>

BIN
jixin/src/main/res/mipmap-xhdpi/rad_packet_fragment_bg.png


BIN
jixin/src/main/res/mipmap-xhdpi/red_packet_send_top_bg_.png