-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
21 changed files
with
409 additions
and
24 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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
12 changes: 0 additions & 12 deletions
12
SeoulSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/MainActivity.kt
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
SeoulSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/ui/badge/BadgeFragment.kt
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,26 @@ | ||
package com.yamgang.seoulsantaandroid.ui.badge | ||
|
||
import android.content.Context | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
import com.yamgang.seoulsantaandroid.R | ||
|
||
class BadgeFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_badge, container, false) | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
SeoulSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/ui/home/HomeFragment.kt
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,26 @@ | ||
package com.yamgang.seoulsantaandroid.ui.home | ||
|
||
import android.content.Context | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
import com.yamgang.seoulsantaandroid.R | ||
|
||
class HomeFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_home, container, false) | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
SeoulSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/ui/home/MainActivity.kt
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,33 @@ | ||
package com.yamgang.seoulsantaandroid.ui.home | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.util.Log | ||
import android.view.View | ||
import com.yamgang.seoulsantaandroid.R | ||
import kotlinx.android.synthetic.main.activity_main.* | ||
|
||
class MainActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
|
||
viewInit() | ||
} | ||
|
||
private fun viewInit(){ | ||
vp_main_act_pager.apply{ | ||
adapter = MainTabFragmentStatePagerAdapter(supportFragmentManager, 4) | ||
offscreenPageLimit = 4 | ||
} | ||
|
||
tl_main_act_bottom_bar.setupWithViewPager(vp_main_act_pager, true) | ||
|
||
val tabLayout: View = this.layoutInflater.inflate(R.layout.tab_main_activity, null, false) | ||
tl_main_act_bottom_bar.getTabAt(0)!!.customView = tabLayout.findViewById(R.id.btn_tab_main_act_home) | ||
tl_main_act_bottom_bar.getTabAt(1)!!.customView = tabLayout.findViewById(R.id.btn_tab_main_act_map) | ||
tl_main_act_bottom_bar.getTabAt(2)!!.customView = tabLayout.findViewById(R.id.btn_tab_main_act_search) | ||
tl_main_act_bottom_bar.getTabAt(3)!!.customView = tabLayout.findViewById(R.id.btn_tab_main_act_badge) | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...p/src/main/java/com/yamgang/seoulsantaandroid/ui/home/MainTabFragmentStatePagerAdapter.kt
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,26 @@ | ||
package com.yamgang.seoulsantaandroid.ui.home | ||
|
||
import androidx.fragment.app.Fragment | ||
import androidx.fragment.app.FragmentManager | ||
import androidx.fragment.app.FragmentStatePagerAdapter | ||
import com.yamgang.seoulsantaandroid.ui.badge.BadgeFragment | ||
import com.yamgang.seoulsantaandroid.ui.home.HomeFragment | ||
import com.yamgang.seoulsantaandroid.ui.map.MapFragment | ||
import com.yamgang.seoulsantaandroid.ui.search.SearchFragment | ||
|
||
class MainTabFragmentStatePagerAdapter(fm: FragmentManager, private val fragmentCount: Int) : | ||
FragmentStatePagerAdapter(fm) { | ||
|
||
override fun getItem(position: Int): Fragment { | ||
when (position) { | ||
0 -> return HomeFragment() | ||
1 -> return MapFragment() | ||
2 -> return SearchFragment() | ||
3 -> return BadgeFragment() | ||
else -> return HomeFragment() | ||
} | ||
} | ||
|
||
override fun getCount(): Int = fragmentCount | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
SeoulSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/ui/map/MapFragment.kt
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,26 @@ | ||
package com.yamgang.seoulsantaandroid.ui.map | ||
|
||
import android.content.Context | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
import com.yamgang.seoulsantaandroid.R | ||
|
||
class MapFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_map, container, false) | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...lSantaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/ui/search/SearchFragment.kt
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,25 @@ | ||
package com.yamgang.seoulsantaandroid.ui.search | ||
|
||
import android.content.Context | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
|
||
import com.yamgang.seoulsantaandroid.R | ||
|
||
class SearchFragment : Fragment() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_search, container, false) | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ntaAndroid/app/src/main/java/com/yamgang/seoulsantaandroid/util/SwipeDisabledViewPager.kt
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,51 @@ | ||
package com.yamgang.seoulsantaandroid.util | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.MotionEvent | ||
import androidx.core.view.MotionEventCompat | ||
import androidx.viewpager.widget.ViewPager | ||
|
||
class SwipeDisabledViewPager : ViewPager { | ||
var enable = false | ||
|
||
constructor(ctx: Context) : super(ctx) | ||
|
||
constructor(ctx: Context, attrs: AttributeSet) : super(ctx, attrs) | ||
|
||
override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean { | ||
|
||
if (enable) { | ||
return super.onInterceptTouchEvent(ev) | ||
} else { | ||
if (MotionEventCompat.getActionMasked(ev) == MotionEvent.ACTION_MOVE) { | ||
// ignore move action | ||
} else { | ||
if (super.onInterceptTouchEvent(ev)) { | ||
super.onTouchEvent(ev) | ||
} | ||
} | ||
return false | ||
} | ||
} | ||
|
||
override fun onTouchEvent(ev: MotionEvent?): Boolean { | ||
if (enable) { | ||
return super.onTouchEvent(ev) | ||
} else { | ||
return MotionEventCompat.getActionMasked(ev) != MotionEvent.ACTION_MOVE && super.onTouchEvent(ev) | ||
} | ||
} | ||
|
||
override fun setCurrentItem(item: Int, smoothScroll: Boolean) { | ||
super.setCurrentItem(item, false) | ||
} | ||
|
||
override fun setCurrentItem(item: Int) { | ||
super.setCurrentItem(item, false) | ||
} | ||
|
||
fun setPagingEnabled(enable: Boolean) { | ||
this.enable = enable | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
SeoulSantaAndroid/app/src/main/res/layout/fragment_badge.xml
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,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=".ui.badge.BadgeFragment"> | ||
|
||
<!-- TODO: Update blank fragment layout --> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="BADGE"/> | ||
|
||
</FrameLayout> |
14 changes: 14 additions & 0 deletions
14
SeoulSantaAndroid/app/src/main/res/layout/fragment_home.xml
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,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=".ui.home.HomeFragment"> | ||
|
||
<!-- TODO: Update blank fragment layout --> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="HOME"/> | ||
|
||
</FrameLayout> |
13 changes: 13 additions & 0 deletions
13
SeoulSantaAndroid/app/src/main/res/layout/fragment_map.xml
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,13 @@ | ||
<?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=".ui.map.MapFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="MAP"/> | ||
|
||
</FrameLayout> |
Oops, something went wrong.