-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,42 @@ | ||
package com.example.proj2; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.ImageView; | ||
|
||
import androidx.activity.EdgeToEdge; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.core.graphics.Insets; | ||
import androidx.core.view.ViewCompat; | ||
import androidx.core.view.WindowInsetsCompat; | ||
import androidx.navigation.fragment.NavHostFragment; | ||
|
||
public class Item_selection extends AppCompatActivity { | ||
Button m_btn; | ||
ImageView imageView; | ||
boolean i = true; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
EdgeToEdge.enable(this); | ||
setContentView(R.layout.activity_item_selection); | ||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { | ||
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); | ||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); | ||
return insets; | ||
|
||
Button button1 = findViewById(R.id.button1); | ||
button1.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(Item_selection.this, SecondFragment.class); | ||
|
||
//The transmission of data for image modification. | ||
intent.putExtra("imageResourceId", R.drawable.doran_blade); | ||
|
||
//move to SecondFragment | ||
startActivity(intent); | ||
} | ||
}); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters