Feat(main activity): Wireframing 1/2

This commit is contained in:
minhtrannhat 2023-11-03 20:59:27 -04:00
parent ecc7a39bf8
commit 9a29af2f3c
Signed by: minhtrannhat
GPG Key ID: E13CFA85C53F8062
10 changed files with 104 additions and 20 deletions

7
.idea/discord.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="PROJECT_FILES" />
<option name="description" value="" />
</component>
</project>

4
.idea/misc.xml generated
View File

@ -1,8 +1,4 @@
<project version="4"> <project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />

View File

@ -4,12 +4,12 @@ plugins {
android { android {
namespace 'com.example.coen390_assignment2' namespace 'com.example.coen390_assignment2'
compileSdk 33 compileSdk 34
defaultConfig { defaultConfig {
applicationId "com.example.coen390_assignment2" applicationId "com.example.coen390_assignment2"
minSdk 26 minSdk 26
targetSdk 33 targetSdk 34
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"

View File

@ -13,7 +13,15 @@
android:theme="@style/Theme.Coen390_assignment2" android:theme="@style/Theme.Coen390_assignment2"
tools:targetApi="31"> tools:targetApi="31">
<activity <activity
android:name=".MainActivity" android:name=".Views.ProfileActivity"
android:exported="false"
android:parentActivityName=".Views.MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Views.MainActivity" />
</activity>
<activity
android:name=".Views.MainActivity"
android:exported="true"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View File

@ -0,0 +1,29 @@
package com.example.coen390_assignment2.Views;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.os.Bundle;
import android.view.Menu;
import com.example.coen390_assignment2.R;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize the ActionBar (Toolbar)
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setSubtitle("New Subtitle Text !!!!!!!!!!!!!!");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.settings_main_activity, menu);
return true;
}
}

View File

@ -1,14 +1,16 @@
package com.example.coen390_assignment2; package com.example.coen390_assignment2.Views;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle; import android.os.Bundle;
public class MainActivity extends AppCompatActivity { import com.example.coen390_assignment2.R;
public class ProfileActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_profile);
} }
} }

View File

@ -1,18 +1,43 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity"> tools:context=".Views.MainActivity">
<TextView <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:subtitle="Subtitle Text"
app:subtitleTextColor="#FFFFFF"
app:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:title="Main Activity"
app:titleTextColor="#FFFFFF" />
<!-- Content Layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="64dp"
android:orientation="vertical">
<ListView
android:id="@+id/profilesListView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<!-- Action Button at the bottom right -->
<Button
android:id="@+id/actionButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Hello World!" android:layout_alignParentEnd="true"
app:layout_constraintBottom_toBottomOf="parent" android:layout_alignParentBottom="true"
app:layout_constraintEnd_toEndOf="parent" android:layout_margin="16dp"
app:layout_constraintStart_toStartOf="parent" android:text="@string/add_profile_text_action_button" />
app:layout_constraintTop_toTopOf="parent" /> </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Views.ProfileActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/toggle_profiles_display_mode"
android:title="@string/toggle_profiles_display_mode_text" />
</menu>

View File

@ -1,3 +1,5 @@
<resources> <resources>
<string name="app_name">coen390_assignment2</string> <string name="app_name">coen390_assignment2</string>
<string name="add_profile_text_action_button">Add Profile</string>
<string name="toggle_profiles_display_mode_text">By ID</string>
</resources> </resources>