-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetailedMenu4.java
More file actions
74 lines (65 loc) · 2.77 KB
/
DetailedMenu4.java
File metadata and controls
74 lines (65 loc) · 2.77 KB
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
72
73
74
package com.example.opensource_project;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.Toast;
import static android.content.ContentValues.TAG;
public class DetailedMenu4 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.detailed_menu4);
Intent intent = getIntent();
int auth = intent.getExtras().getInt("auth");
Button generate_button = (Button) findViewById(R.id.generate_button);
if(auth == 0){ // 관리자
Log.d(TAG, "Inserted auth: " + auth);
generate_button.setVisibility(View.VISIBLE);
}
else if(auth == 1){ // 일반 사용자
Log.d(TAG, "Inserted auth: " + auth);
generate_button.setVisibility(View.GONE);
}
generate_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), RegisterProduct.class);
startActivity(intent);
}
});
LinearLayout linearButton1 = (LinearLayout) findViewById(R.id.linear1);
LinearLayout linearButton2 = (LinearLayout) findViewById(R.id.linear2);
LinearLayout linearButton3 = (LinearLayout) findViewById(R.id.linear3);
LinearLayout linearButton4 = (LinearLayout) findViewById(R.id.linear4);
linearButton1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent intent = new Intent(getApplicationContext(), Payment.class);
startActivity(intent);
}
});
linearButton2.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Toast.makeText(DetailedMenu4.this, "모든 상품이 품절되었습니다.", Toast.LENGTH_SHORT).show();
}
});
linearButton3.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Toast.makeText(DetailedMenu4.this, "모든 상품이 품절되었습니다.", Toast.LENGTH_SHORT).show();
}
});
linearButton4.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Toast.makeText(DetailedMenu4.this, "모든 상품이 품절되었습니다.", Toast.LENGTH_SHORT).show();
}
});
}
}