Skip to content

Commit

Permalink
Merge pull request #175 from ncapdevi/3.0.0
Browse files Browse the repository at this point in the history
3.0.0
  • Loading branch information
ncapdevi authored Nov 19, 2018
2 parents ef95c10 + 099c8e0 commit 996aecd
Show file tree
Hide file tree
Showing 23 changed files with 465 additions and 182 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.idea
/.idea/

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ dependencies {
implementation project(':frag-nav')
// implementation 'com.ncapdevi:frag-nav:2.2.1'
implementation project(':frag-nav')
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
implementation "com.android.support:design:$rootProject.ext.supportVersion"
implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion"
implementation "com.roughike:bottom-bar:2.3.1"
testImplementation "junit:junit:$rootProject.ext.junitVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.ncapdevi.sample">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import com.ncapdevi.fragnav.FragNavController
import com.ncapdevi.fragnav.FragNavLogger
import com.ncapdevi.fragnav.FragNavSwitchController
import com.ncapdevi.fragnav.FragNavTransactionOptions
import com.ncapdevi.fragnav.tabhistory.FragNavTabHistoryController
import com.ncapdevi.fragnav.tabhistory.UniqueTabHistoryStrategy
import com.ncapdevi.sample.R
import com.ncapdevi.sample.fragments.*
import com.roughike.bottombar.BottomBar


class BottomTabsActivity : AppCompatActivity(), BaseFragment.FragmentNavigation, FragNavController.TransactionListener, FragNavController.RootFragmentListener {
override val numberOfRootFragments: Int = 5

Expand Down Expand Up @@ -55,8 +53,6 @@ class BottomTabsActivity : AppCompatActivity(), BaseFragment.FragmentNavigation,
bottomBar.selectTabAtPosition(INDEX_NEARBY)
}


fragNavController.executePendingTransactions()
bottomBar.setOnTabSelectListener({ tabId ->
when (tabId) {
R.id.bb_menu_recents -> fragNavController.switchTab(INDEX_RECENTS)
Expand All @@ -68,7 +64,6 @@ class BottomTabsActivity : AppCompatActivity(), BaseFragment.FragmentNavigation,
}, initial)

bottomBar.setOnTabReselectListener { fragNavController.clearStack() }

}

override fun onBackPressed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ open class BaseFragment : Fragment() {
}

companion object {
val ARGS_INSTANCE = "com.ncapdevi.sample.argsInstance"
const val ARGS_INSTANCE = "com.ncapdevi.sample.argsInstance"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

Expand All @@ -8,12 +9,13 @@ import android.view.View
*/
class FavoritesFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FavoritesFragment.newInstance(mInt + 1))
}
btn.text = javaClass.simpleName + " " + mInt
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

Expand All @@ -8,12 +9,13 @@ import android.view.View
*/
class FoodFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FoodFragment.newInstance(mInt + 1))
}
btn.text = javaClass.simpleName + " " + mInt
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

Expand All @@ -9,12 +10,13 @@ import android.view.View
class FriendsFragment : BaseFragment() {


@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(FriendsFragment.newInstance(mInt + 1))
}
btn.text = javaClass.simpleName + " " + mInt
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

Expand All @@ -8,12 +9,13 @@ import android.view.View
*/
class NearbyFragment : BaseFragment() {

@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(NearbyFragment.newInstance(mInt + 1))
}
btn.text = javaClass.simpleName + " " + mInt
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ncapdevi.sample.fragments

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View

Expand All @@ -9,12 +10,13 @@ import android.view.View
class RecentsFragment : BaseFragment() {


@SuppressLint("SetTextI18n")
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
btn.setOnClickListener {
mFragmentNavigation.pushFragment(RecentsFragment.newInstance(mInt + 1))
}
btn.text = javaClass.simpleName + " " + mInt
btn.text = """${javaClass.simpleName} $mInt"""
}

companion object {
Expand Down
20 changes: 13 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
tools:context=".activities.MainActivity"
android:id="@+id/container" android:orientation="vertical" android:gravity="center">
tools:ignore="HardcodedText">

<Button
android:id="@+id/btnBottomTabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Bottom Tabs"
android:id="@+id/btnBottomTabs" android:layout_gravity="center_horizontal"/>
android:layout_gravity="center_horizontal"
android:text="Bottom Tabs" />

<Button
android:id="@+id/btnNavDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Navigation Drawer"
android:id="@+id/btnNavDrawer" android:layout_gravity="center_horizontal"/>
android:layout_gravity="center_horizontal"
android:text="Navigation Drawer" />
</LinearLayout>
9 changes: 6 additions & 3 deletions app/src/main/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
tools:ignore="HardcodedText" >

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<EditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
tools:ignore="LabelFor"
android:inputType="text" />
<CheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
Expand Down
23 changes: 12 additions & 11 deletions app/src/main/res/layout/nav_header_nav_drawer.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
android:layout_width="match_parent"
android:layout_height="@dimen/nav_header_height"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/side_nav_bar"
android:gravity="bottom"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
tools:ignore="HardcodedText">

<TextView
android:layout_width="match_parent"
Expand All @@ -19,7 +21,6 @@
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="www.github.com/ncapdevi/FragNav"/>
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/menu/activity_nav_drawer_drawer.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="HardcodedText">

<item
android:id="@+id/bb_menu_recents"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="nav_header_vertical_spacing">16dp</dimen>
<dimen name="nav_header_height">120dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<resources>
<string name="app_name">FragNav</string>
<string name="title_activity_main2">Main2Activity</string>

<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>

<string name="action_settings">Settings</string>
<string name="title_activity_nav_drawer">NavDrawerActivity</string>
</resources>
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
buildscript {
ext.kotlin_version = '1.2.40'
ext.kotlin_version = '1.2.71'
repositories {
jcenter()
google()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.32"
}
}

allprojects {
repositories {
jcenter()
google()
jcenter()
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
}

repositories {
google()
jcenter()
mavenCentral()
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Expand All @@ -27,8 +34,8 @@ ext {

junitVersion = '4.12'
supportVersion = '27.1.1'
buildToolsVersion = '27.0.3'
buildToolsVersion = '28.0.3'
minSdkVersion = 14
targetSdkVersion = 27
compileSdkVersion = 27
targetSdkVersion = 28
compileSdkVersion = 28
}
3 changes: 2 additions & 1 deletion frag-nav/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/build
pom.xml
pom.xml
.idea
Loading

0 comments on commit 996aecd

Please sign in to comment.