admin
2020-08-12 cefe2a41db4a275fb1e940a902cb156f1ed68d80
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.weikou.beibeivideo.ui.discover;
 
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
 
import com.weikou.beibeivideo.ui.BaseActivity;
import com.yeshi.buwanshequ.R;
 
/**
 * Created by weikou2015 on 2017/1/3.
 */
 
public class ReleaseGoodsActivity extends BaseActivity implements View.OnClickListener {
    TextView tv_top_left;
    TextView tv_top_middle;
 
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.activity_release_goods);
         /*
         * 计算状态栏高度并设置
         */
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            Window window = getWindow();
            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
                    WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            int result = 0;
            int resourceId = getResources().getIdentifier("status_bar_height",
                    "dimen", "android");
            if (resourceId > 0) {
                result = getResources().getDimensionPixelSize(resourceId);
            }
            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                    result);
            findViewById(R.id.v_status_bar).setLayoutParams(params);
        } else {
            findViewById(R.id.v_status_bar).setVisibility(View.GONE);
        }
        tv_top_left = (TextView) findViewById(R.id.tv_top_bar_left);
        tv_top_middle = (TextView) findViewById(R.id.tv_top_bar_middle);
        tv_top_middle.setText("发布");
        tv_top_left.setOnClickListener(this);
        findViewById(R.id.tv_relsease_confirm).setOnClickListener(this);
    }
 
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_top_bar_left:
                finish();
                break;
            case R.id.tv_relsease_confirm:
                uploadGoods();
                break;
        }
    }
 
    /**
     * 上传商品信息
     */
    private void uploadGoods() {
 
    }
 
}