Skip to content

Commit

Permalink
UI 변경중
Browse files Browse the repository at this point in the history
  • Loading branch information
msnodeve committed Sep 8, 2019
1 parent d1fbe16 commit 75b9739
Show file tree
Hide file tree
Showing 16 changed files with 176 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions .idea/navEditor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/render.experimental.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,18 @@ jacocoAndroidUnitTestReport {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:design:28.0.0'

// test implementation
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'org.powermock:powermock-api-mockito:1.4.12'
testImplementation 'org.powermock:powermock-module-junit4:1.6.2'
testImplementation 'org.mockito:mockito-core:2.28.2'
testImplementation 'androidx.arch.core:core-testing:2.0.1'
testImplementation 'androidx.arch.core:core-testing:2.1.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
Expand All @@ -89,7 +91,7 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'

// Google Ads
implementation 'com.google.android.gms:play-services-ads:18.1.1'
implementation 'com.google.android.gms:play-services-ads:18.2.0'

// OkHttp && logger
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
Expand All @@ -106,9 +108,9 @@ dependencies {
kaptTest 'androidx.room:room-testing:2.1.0'

// Lifecycle components
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'android.arch.lifecycle:viewmodel:1.1.1'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'

// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
Expand All @@ -129,4 +131,6 @@ dependencies {

//ProgressBar
implementation 'com.wang.avi:library:2.1.3'
implementation 'androidx.navigation:navigation-fragment-ktx:2.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</intent-filter>
</activity>
<activity android:name=".views.MainActivity" />
<activity android:name=".views.Main2Activity" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class LauncherActivity : AppCompatActivity() {
startActivity(intent)
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
finish()
}, 1500)
}, 200)
}
}
17 changes: 10 additions & 7 deletions app/src/main/java/com/seok/gitfordeveloper/views/LoginActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
init()
checkForSignIn()
login_img_login.setOnClickListener {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(authToken.buildHttpUrl(BuildConfig.GITHUB_CLIENT_ID)))
startActivityForResult(intent, HttpURLConnection.HTTP_OK)
}
startActivity(Intent(this, Main2Activity::class.java))
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
finish()
// init()
// checkForSignIn()
// login_img_login.setOnClickListener {
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(authToken.buildHttpUrl(BuildConfig.GITHUB_CLIENT_ID)))
// startActivityForResult(intent, HttpURLConnection.HTTP_OK)
// }
}

private fun init() {
Expand Down Expand Up @@ -80,7 +83,7 @@ class LoginActivity : AppCompatActivity() {
}

private fun goToMainActivity() {
startActivity(Intent(this, MainActivity::class.java))
startActivity(Intent(this, Main2Activity::class.java))
overridePendingTransition(R.anim.fade_in, R.anim.fade_out)
finish()
}
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/seok/gitfordeveloper/views/Main2Activity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.seok.gitfordeveloper.views

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.seok.gitfordeveloper.R

class Main2Activity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.fragment_main)
}
}
19 changes: 15 additions & 4 deletions app/src/main/java/com/seok/gitfordeveloper/views/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Gravity
import android.view.MenuItem
import android.widget.LinearLayout
import android.widget.TextView
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.bumptech.glide.Glide
import com.google.android.gms.ads.AdRequest
import com.google.android.gms.ads.MobileAds
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.seok.gitfordeveloper.BuildConfig
import com.seok.gitfordeveloper.R
import com.seok.gitfordeveloper.database.Commits
import com.seok.gitfordeveloper.utils.*
import com.seok.gitfordeveloper.viewmodel.MainViewModel
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.activity_main2.*
import org.jetbrains.anko.*

class MainActivity : AppCompatActivity() {
Expand All @@ -30,10 +33,18 @@ class MainActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
init()
checkForUserInfo()
initViewModelFun()
setContentView(R.layout.activity_main2)
bottom_navigation.setOnNavigationItemSelectedListener {
when(it.itemId){
R.id.nav_menu_f -> longToast("1")
R.id.nav_menu_s -> longToast("2")
}
true
}

// init()
// checkForUserInfo()
// initViewModelFun()
}

private fun init() {
Expand Down
23 changes: 23 additions & 0 deletions app/src/main/java/com/seok/gitfordeveloper/views/MainFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.seok.gitfordeveloper.views


import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import com.seok.gitfordeveloper.R

/**
* A simple [Fragment] subclass.
*/
class MainFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_main, container, false)
}
}
20 changes: 20 additions & 0 deletions app/src/main/res/layout/activity_main2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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">

<!-- Main content -->

<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
app:itemIconTint="@color/iconText"
app:itemTextColor="@color/iconText"
app:menu="@menu/bottom_navigation_menu" />

</FrameLayout>
14 changes: 14 additions & 0 deletions app/src/main/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".views.MainFragment">

<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />

</FrameLayout>
12 changes: 12 additions & 0 deletions app/src/main/res/menu/bottom_navigation_menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:id="@+id/nav_menu_f"
android:title="@string/navigation_menu_main"
android:icon="@mipmap/ic_launcher_foreground_gfd"
android:enabled="true"/>
<item android:id="@+id/nav_menu_s"
android:title="@string/navigation_menu_main"
android:icon="@mipmap/ic_launcher_foreground_gfd"
android:enabled="true"/>
</menu>
14 changes: 14 additions & 0 deletions app/src/main/res/navigation/bottom_navigation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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/bottom_navigation"
tools:ignore="UnusedNavigation"
app:startDestination="@id/mainFragment">

<fragment
android:id="@+id/mainFragment"
android:name="com.seok.gitfordeveloper.views.MainFragment"
android:label="fragment_main"
tools:layout="@layout/fragment_main" />
</navigation>
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

<!-- APP UI Color -->
<color name="colorTopBar">#444444</color>

<color name="iconText">#e4f9f5</color>
</resources>
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<string name="invalid_token">로그인 토큰 발급을 실패하였습니다\n다시 시도 해주세요</string>
<string name="today_contribution">Today contribution : </string>
<string name="max_contribution">Max contribution : </string>
<string name="navigation_menu_main">Main</string>

<!-- Project String env -->
<string name="no_token">Empty token</string>
Expand All @@ -26,4 +27,7 @@
<string name="admob_app_id">ca-app-pub-2766237193476584~8461542866</string>
<string name="banner_ad_unit_id">ca-app-pub-2766237193476584/5575239666</string>
<string name="banner_ad_unit_id_for_test">ca-app-pub-3940256099942544/6300978111</string>

<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>

0 comments on commit 75b9739

Please sign in to comment.