Skip to content

Commit

Permalink
modified fps release version
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceDut committed May 22, 2019
1 parent aed7844 commit 27bce8c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
12 changes: 5 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

debugImplementation project(':fpsviewer')
// debugImplementation project(':fpsviewer')
// releaseImplementation project(':fpsviewer-no-op')
debugImplementation "com.github.silencedut.fpsviewer:fpsviewer:0.7.4"
releaseImplementation "com.github.silencedut.fpsviewer:fpsviewer-no-op:0.7.4"

implementation "com.android.support:appcompat-v7:$_supportVersion"
// implementation "com.github.silencedut:fpsviewer:0.6.7"

implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// implementation com.android.support.constraint:constraint-layout:2.0.0"
implementation "com.android.support.constraint:constraint-layout:1.1.3"
implementation "com.android.support:design:28.0.0"

testImplementation 'junit:junit:4.12'

debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.3'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.3'
// Optional, if you use support library fragments:
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.3'
}
10 changes: 2 additions & 8 deletions app/src/main/java/com/silencedut/fpsviewersample/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.silencedut.fpsviewersample

import android.app.Application
import com.silencedut.fpsviewer.FpsViewer
import com.squareup.leakcanary.LeakCanary


/**
* @author SilenceDut
Expand All @@ -11,12 +11,6 @@ import com.squareup.leakcanary.LeakCanary
class App : Application() {
override fun onCreate() {
super.onCreate()
FpsViewer.getViewer().initViewer(this)
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return
}
LeakCanary.install(this)
FpsViewer.getViewer().initViewer(this,null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import android.support.v7.app.AppCompatActivity
import android.util.Log
import android.view.Choreographer
import android.widget.TextView

import com.silencedut.fpsviewer.api.ISniper
import com.silencedut.fpsviewer.transfer.TransferCenter
import com.silencedut.fpsviewer.FpsViewer


import kotlinx.android.synthetic.main.activity_main.*
Expand All @@ -37,13 +35,13 @@ class MainActivity : AppCompatActivity() {

R.id.navigation_dashboard -> {
message.setText(R.string.title_dashboard)
TransferCenter.getImpl(ISniper::class.java).appendSection("TestSection")
FpsViewer.getViewer().appendSection("TestSection")
testToastB()
return@OnNavigationItemSelectedListener true
}
R.id.navigation_notifications -> {
message.setText(R.string.title_notifications)
TransferCenter.getImpl(ISniper::class.java).removeSection("TestSection")
FpsViewer.getViewer().removeSection("TestSection")
return@OnNavigationItemSelectedListener true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Application;
import android.support.annotation.Nullable;
import android.support.v4.os.TraceCompat;
import com.silencedut.fpsviewer.api.IDisplayFps;
import com.silencedut.fpsviewer.api.IEventRelay;
import com.silencedut.fpsviewer.api.ISniper;
Expand Down
9 changes: 9 additions & 0 deletions fpsviewer/src/main/java/com/silencedut/fpsviewer/IViewer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ import com.silencedut.fpsviewer.transfer.ITransfer
interface IViewer :ITransfer {
fun initViewer(application: Application,fpsConfig: FpsConfig? = null)
fun fpsConfig():FpsConfig

/**
* like TraceCompat.beginSection();
* 对一些卡顿的堆栈进行标记,在UI上展示
*/
fun appendSection(sectionName:String)

/**
* like TraceCompat.endSection();
*/
fun removeSection(sectionName:String)
}

0 comments on commit 27bce8c

Please sign in to comment.