Skip to content
This repository has been archived by the owner on May 19, 2022. It is now read-only.

Commit

Permalink
add base fragment,
Browse files Browse the repository at this point in the history
change TAG init to construct
  • Loading branch information
Mystery00 committed Apr 5, 2018
1 parent 020b936 commit 176a4f6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
7 changes: 7 additions & 0 deletions .idea/dictionaries/myste.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.21'
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
Expand Down
8 changes: 1 addition & 7 deletions tools/src/main/java/vip/mystery0/tools/base/BaseActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,12 @@

package vip.mystery0.tools.base

import android.os.Bundle
import android.support.annotation.StringRes
import android.support.v7.app.AppCompatActivity
import android.widget.Toast

abstract class BaseActivity : AppCompatActivity() {
lateinit var TAG: String

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
TAG = javaClass.simpleName
}
var TAG = javaClass.simpleName

fun toastMessage(@StringRes id: Int, duration: Int = Toast.LENGTH_SHORT) {
toastMessage(getString(id), duration)
Expand Down
17 changes: 17 additions & 0 deletions tools/src/main/java/vip/mystery0/tools/base/BaseFragment.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package vip.mystery0.tools.base

import android.support.annotation.StringRes
import android.support.v4.app.Fragment
import android.widget.Toast

abstract class BaseFragment : Fragment() {
var TAG = javaClass.simpleName

fun toastMessage(@StringRes id: Int, duration: Int = Toast.LENGTH_SHORT) {
toastMessage(getString(id), duration)
}

fun toastMessage(message: String, duration: Int = Toast.LENGTH_SHORT) {
Toast.makeText(context, message, duration).show()
}
}

0 comments on commit 176a4f6

Please sign in to comment.