Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
vocabulary_notebook
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7eae68a2
authored
Sep 07, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserActivity is now with nav bar
parent
0a8a8faf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
85 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/paktalin/vocabularynotebook/activities/UserActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/activities/VocabularyActivity.java
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_user.xml
app/src/main/res/layout/content_main.xml
app/src/main/AndroidManifest.xml
View file @
7eae68a2
...
...
@@ -17,8 +17,6 @@
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".activities.UserActivity"
/>
<activity
android:name=
".activities.LogInActivity"
>
</activity>
<activity
android:name=
".activities.VocabularyActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/paktalin/vocabularynotebook/activities/UserActivity.kt
View file @
7eae68a2
...
...
@@ -2,6 +2,7 @@ package com.paktalin.vocabularynotebook.activities
import
android.annotation.SuppressLint
import
android.os.Bundle
import
android.support.design.widget.NavigationView
import
android.support.v7.app.AppCompatActivity
import
android.util.Log
...
...
@@ -10,7 +11,8 @@ import com.google.firebase.firestore.DocumentReference
import
com.google.firebase.firestore.DocumentSnapshot
import
com.google.firebase.firestore.FirebaseFirestore
import
com.paktalin.vocabularynotebook.R
import
kotlinx.android.synthetic.main.activity_user.*
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.content_main.*
class
UserActivity
:
AppCompatActivity
()
{
...
...
@@ -19,7 +21,15 @@ class UserActivity : AppCompatActivity() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_user
)
setContentView
(
R
.
layout
.
activity_main
)
val
navigationView
=
findViewById
<
NavigationView
>(
R
.
id
.
navigationView
)
navigationView
.
setNavigationItemSelectedListener
{
menuItem
->
menuItem
.
isChecked
=
true
drawerLayout
!!
.
closeDrawers
()
true
}
extractUserDocument
()
printUserData
()
...
...
app/src/main/java/com/paktalin/vocabularynotebook/activities/VocabularyActivity.java
deleted
100644 → 0
View file @
0a8a8faf
package
com
.
paktalin
.
vocabularynotebook
.
activities
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.NavigationView
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v7.app.AppCompatActivity
;
import
android.view.MenuItem
;
import
com.paktalin.vocabularynotebook.R
;
public
class
VocabularyActivity
extends
AppCompatActivity
{
private
DrawerLayout
mDrawerLayout
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
/*mDrawerLayout = findViewById(R.id.drawer_layout);
NavigationView navigationView = findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(
new NavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(MenuItem menuItem) {
// set item as selected to persist highlight
menuItem.setChecked(true);
// close drawer when item is tapped
mDrawerLayout.closeDrawers();
// Add code here to update the UI based on the item selected
// For example, swap UI fragments here
return true;
}
});*/
}
}
app/src/main/res/layout/activity_main.xml
View file @
7eae68a2
...
...
@@ -3,7 +3,7 @@
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
_l
ayout"
android:id=
"@+id/drawer
L
ayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:openDrawer=
"start"
>
...
...
@@ -14,7 +14,7 @@
android:layout_height=
"match_parent"
/>
<android.support.design.widget.NavigationView
android:id=
"@+id/nav
_v
iew"
android:id=
"@+id/nav
igationV
iew"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
...
...
app/src/main/res/layout/activity_user.xml
deleted
100644 → 0
View file @
0a8a8faf
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/tvCongrats"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Congratulations! You have successfully logged in!"
app:layout_constraintBottom_toTopOf=
"@+id/tvUserData"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/tvUserData"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvCongrats"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/content_main.xml
View file @
7eae68a2
...
...
@@ -6,16 +6,33 @@
android:layout_height=
"match_parent"
android:background=
"@android:color/transparent"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
tools:context=
"com.paktalin.vocabularynotebook.activities.
Vocabulary
Activity"
>
tools:context=
"com.paktalin.vocabularynotebook.activities.
User
Activity"
>
<TextView
android:id=
"@+id/t
extView
"
android:id=
"@+id/t
vCongrats
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Welcoming text"
android:text=
"Congratulations! You have successfully logged in!"
app:layout_constraintBottom_toTopOf=
"@+id/tvUserData"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/tvUserData"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.5"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_to
TopOf=
"parent
"
/>
app:layout_constraintTop_to
BottomOf=
"@+id/tvCongrats
"
/>
</android.support.constraint.ConstraintLayout>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment