forked from tirth5828/US_2.0
-
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
1 parent
809bfc7
commit 174b368
Showing
10 changed files
with
214 additions
and
17 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,12 +1,108 @@ | ||
package com.example.us_2_0; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.appcompat.app.ActionBarDrawerToggle; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import androidx.appcompat.widget.Toolbar; | ||
import androidx.drawerlayout.widget.DrawerLayout; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.view.Menu; | ||
import android.view.MenuInflater; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
|
||
import com.google.android.material.navigation.NavigationView; | ||
|
||
public class LandingPage extends AppCompatActivity { | ||
|
||
private ActionBarDrawerToggle actionBarDrawerToggle; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_landing_page); | ||
|
||
|
||
Toolbar toolbar = findViewById(R.id.toolbar); | ||
setSupportActionBar(toolbar); | ||
getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
|
||
DrawerLayout drawerLayout = findViewById(R.id.drawer_layout); | ||
actionBarDrawerToggle = new ActionBarDrawerToggle(LandingPage.this, drawerLayout, R.string.drawer_open, R.string.drawer_close); | ||
drawerLayout.addDrawerListener(actionBarDrawerToggle); | ||
actionBarDrawerToggle.syncState(); | ||
|
||
NavigationView navigationView = findViewById(R.id.navigationView); | ||
View view = navigationView.inflateHeaderView(R.layout.navigation_header); | ||
navigationView.setItemIconTintList(null); | ||
navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { | ||
@Override | ||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | ||
UserItemSelected(item); | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
|
||
private void UserItemSelected(MenuItem item) { | ||
|
||
switch (item.getItemId()){ | ||
|
||
case R.id.share: | ||
|
||
Intent myIntent = new Intent(Intent.ACTION_SEND); | ||
myIntent.setType("text/plain"); | ||
String shareBody = "http://play.google.com/store/apps/details?id="+getPackageName(); | ||
String shareSub = " Thanks for Sharing"; | ||
myIntent.putExtra(Intent.EXTRA_SUBJECT,shareSub); | ||
myIntent.putExtra(Intent.EXTRA_TEXT,shareBody); | ||
startActivity(Intent.createChooser(myIntent,"Share using")); | ||
break; | ||
|
||
case R.id.more: | ||
|
||
|
||
//onclick more | ||
break; | ||
|
||
case R.id.rate: | ||
|
||
//onclick rate | ||
break; | ||
|
||
case R.id.privacy: | ||
|
||
//onclick privacy | ||
break; | ||
} | ||
|
||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(@NonNull MenuItem item) { | ||
if (actionBarDrawerToggle.onOptionsItemSelected(item)){ | ||
return true; | ||
} | ||
|
||
else if (item.getItemId()==R.id.about){ | ||
|
||
//onclick for about | ||
|
||
}else if (item.getItemId()==R.id.disclaimer){ | ||
|
||
//onclick for disclaimer | ||
|
||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
MenuInflater menuInflater = getMenuInflater(); | ||
menuInflater.inflate(R.menu.action_bar_menu,menu); | ||
return super.onCreateOptionsMenu(menu); | ||
} | ||
} | ||
} |
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
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,19 +1,50 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
<androidx.drawerlayout.widget.DrawerLayout 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:id="@+id/drawer_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".LandingPage"> | ||
android:background="#2196F3" | ||
android:backgroundTint="#ECECEC" | ||
android:foregroundTint="#8C7676" | ||
tools:context=".MainActivity"> | ||
|
||
<TextView | ||
android:id="@+id/textView3" | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="#5BB4BA" | ||
android:orientation="vertical"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:background="#119499" | ||
android:theme="@style/ThemeOverlay.AppCompat.DayNight" | ||
app:titleTextColor="#FFFFFF" | ||
app:subtitleTextColor="#FFFFFF" | ||
|
||
/> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_weight="1"> | ||
|
||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</LinearLayout> | ||
|
||
<com.google.android.material.navigation.NavigationView | ||
android:id="@+id/navigationView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Welcome" | ||
android:textSize="24sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
android:layout_height="match_parent" | ||
android:layout_gravity="start" | ||
app:menu="@menu/navigation_menu" | ||
android:background="#FFFFFF" | ||
app:itemTextColor="#000000"/> | ||
|
||
|
||
</androidx.drawerlayout.widget.DrawerLayout> |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<item | ||
android:id="@+id/about" | ||
android:title="About" | ||
android:iconTint="#5E5E5E" | ||
app:showAsAction="never"/> | ||
<item | ||
android:id="@+id/disclaimer" | ||
android:title="Disclaimer" | ||
android:iconTint="#5E5E5E" | ||
app:showAsAction="never"/> | ||
|
||
|
||
|
||
</menu> |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item | ||
android:id="@+id/share" | ||
android:title="Share" | ||
/> | ||
<item | ||
android:id="@+id/more" | ||
android:title="More Apps" | ||
/> | ||
<item | ||
android:id="@+id/rate" | ||
android:title="Feedback" | ||
/> | ||
<item | ||
android:id="@+id/privacy" | ||
android:title="Privacy" | ||
/> | ||
|
||
|
||
|
||
|
||
</menu> |
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
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,3 +1,6 @@ | ||
<resources> | ||
<string name="app_name">US_2_0</string> | ||
|
||
<string name="drawer_open">Drawer Open</string> | ||
<string name="drawer_close">Drawer Close</string> | ||
</resources> |
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