Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (C) 2015 Mantas Palaima
* Copyright (C) 2016 Oleg Godovykh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.palaima.debugdrawer.base;

public abstract class DebugModuleAdapter implements DebugModule {

@Override
public void onOpened() {
// do nothing
}

@Override
public void onClosed() {
// do nothing
}

@Override
public void onResume() {
// do nothing
}

@Override
public void onPause() {
// do nothing
}

@Override
public void onStart() {
// do nothing
}

@Override
public void onStop() {
// do nothing
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Mantas Palaima
* Copyright (C) 2016 Oleg Godovykh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,10 +26,9 @@
import android.view.ViewGroup;
import android.widget.TextView;

import io.palaima.debugdrawer.base.DebugModule;

public class BuildModule implements DebugModule {
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class BuildModule extends DebugModuleAdapter {

private final Context context;

Expand Down Expand Up @@ -60,21 +60,6 @@ public void onOpened() {
refresh();
}

@Override
public void onClosed() {

}

@Override
public void onResume() {

}

@Override
public void onPause() {

}

private void refresh() {
try {
final PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
Expand All @@ -83,14 +68,4 @@ private void refresh() {
packageLabel.setText(info.packageName);
} catch (PackageManager.NameNotFoundException e) {}
}

@Override
public void onStart() {

}

@Override
public void onStop() {

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Mantas Palaima
* Copyright (C) 2016 Oleg Godovykh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,9 +26,9 @@
import android.view.ViewGroup;
import android.widget.TextView;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class DeviceModule implements DebugModule {
public class DeviceModule extends DebugModuleAdapter {

private String deviceMake;
private String deviceModel;
Expand Down Expand Up @@ -101,34 +102,4 @@ public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup pa

return view;
}

@Override
public void onOpened() {

}

@Override
public void onClosed() {

}

@Override
public void onResume() {

}

@Override
public void onPause() {

}

@Override
public void onStart() {

}

@Override
public void onStop() {

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Mantas Palaima
* Copyright (C) 2016 Oleg Godovykh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,9 +27,9 @@
import android.widget.CompoundButton;
import android.widget.Switch;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class NetworkModule implements DebugModule {
public class NetworkModule extends DebugModuleAdapter {

private final Context context;

Expand Down Expand Up @@ -85,26 +86,6 @@ public void onCheckedChanged(CompoundButton button, boolean isChecked) {
return view;
}

@Override
public void onOpened() {

}

@Override
public void onClosed() {

}

@Override
public void onResume() {

}

@Override
public void onPause() {

}

@Override
public void onStop() {
networkController.setOnNetworkChangedListener(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2014 LemonLabs
* Copyright (C) 2015 Mantas Palaima
* Copyright (C) 2016 Oleg Godovykh
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,9 +30,9 @@
import android.widget.ImageView;
import android.widget.Toast;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class SettingsModule implements DebugModule, View.OnClickListener {
public class SettingsModule extends DebugModuleAdapter implements View.OnClickListener {

private final Context context;

Expand Down Expand Up @@ -86,36 +87,6 @@ public View onCreateView(@NonNull LayoutInflater inflater, @NonNull ViewGroup pa
return view;
}

@Override
public void onOpened() {

}

@Override
public void onClosed() {

}

@Override
public void onResume() {

}

@Override
public void onPause() {

}

@Override
public void onStart() {

}

@Override
public void onStop() {

}

@Override
public void onClick(View v) {
if (v == developer || v == developerTitle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import android.widget.CompoundButton;
import android.widget.Switch;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;
import jp.wasabeef.takt.Takt;

public class FpsModule implements DebugModule {
public class FpsModule extends DebugModuleAdapter {

private static final boolean HAS_TAKT;

Expand Down Expand Up @@ -59,16 +59,6 @@ public void onCheckedChanged(CompoundButton button, boolean isChecked) {
return view;
}

@Override
public void onOpened() {

}

@Override
public void onClosed() {

}

@Override
public void onResume() {
if (isChecked) {
Expand All @@ -82,14 +72,4 @@ public void onPause() {
program.stop();
}
}

@Override
public void onStart() {

}

@Override
public void onStop() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

import java.lang.reflect.Field;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class GlideModule implements DebugModule {
public class GlideModule extends DebugModuleAdapter {

private static final boolean HAS_GLIDE;

Expand Down Expand Up @@ -92,26 +92,10 @@ public GlideModule(@NonNull Glide glide) {
refresh();
}

@Override public void onClosed() {

}

@Override public void onResume() {
refresh();
}

@Override public void onPause() {

}

@Override public void onStart() {

}

@Override public void onStop() {

}

private void refresh() {
BitmapPool pool = glide.getBitmapPool();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

import com.squareup.okhttp.OkHttpClient;

import io.palaima.debugdrawer.base.DebugModule;
import io.palaima.debugdrawer.base.DebugModuleAdapter;

public class OkHttpModule implements DebugModule {
public class OkHttpModule extends DebugModuleAdapter {

private static final boolean HAS_OKHTTP;

Expand Down Expand Up @@ -86,31 +86,6 @@ public void onOpened() {
refresh();
}

@Override
public void onClosed() {

}

@Override
public void onResume() {

}

@Override
public void onPause() {

}

@Override
public void onStart() {

}

@Override
public void onStop() {

}

private static String sizeString(long bytes) {
String[] units = new String[] { "B", "KB", "MB", "GB" };
int unit = 0;
Expand Down
Loading