diff --git a/com1614080901125/##4/java/MainActivity.xml b/com1614080901125/##4/java/MainActivity.xml new file mode 100644 index 000000000..06fac2432 --- /dev/null +++ b/com1614080901125/##4/java/MainActivity.xml @@ -0,0 +1,64 @@ +package com1614080901125.androidlabs.hzuapps.edu.hkmacgo; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.Button; +import android.widget.TextView; + +public class MainActivity extends AppCompatActivity { + protected TextView textView; + protected Button button ; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + Toolbar toolbar; + toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + textView = findViewById(R.id.textview_01); + button = findViewById(R.id.my_button); + + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(MainActivity.this, SecondActivity.class); + startActivity(intent); + } + }); + FloatingActionButton fab; + fab = findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_com1614080901116, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } +}} \ No newline at end of file diff --git a/com1614080901125/##4/java/SecondActivity.xml b/com1614080901125/##4/java/SecondActivity.xml new file mode 100644 index 000000000..577bfc0f9 --- /dev/null +++ b/com1614080901125/##4/java/SecondActivity.xml @@ -0,0 +1,30 @@ +package com1614080901125.androidlabs.hzuapps.edu.hkmacgo; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +public class secondActivity extends AppCompatActivity { + protected Button button ; + protected TextView tes; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_second); + Toolbar toolbar = findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + + FloatingActionButton fab; + fab = findViewById(R.id.fab); + fab.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show(); + } + }); + } + +} \ No newline at end of file diff --git a/com1614080901125/##4/res/drawable/text4.png b/com1614080901125/##4/res/drawable/text4.png new file mode 100644 index 000000000..e4f616f35 Binary files /dev/null and b/com1614080901125/##4/res/drawable/text4.png differ diff --git a/com1614080901125/##4/res/layout/main_activity.xml b/com1614080901125/##4/res/layout/main_activity.xml new file mode 100644 index 000000000..72888ed5e --- /dev/null +++ b/com1614080901125/##4/res/layout/main_activity.xml @@ -0,0 +1,51 @@ + + + +