]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/ProfileDetailActivity.java
wrap Log.d calls, skipping them on non-debug builds
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / ProfileDetailActivity.java
index e07be3b04683d8e8db212280f81e6280e12bd5bf..ad7401de661079b75510f59eab70b5e4c6d79318 100644 (file)
 package net.ktnx.mobileledger.ui.activity;
 
 import android.os.Bundle;
-import android.util.Log;
 import android.view.Menu;
-import android.view.View;
-
-import com.google.android.material.floatingactionbutton.FloatingActionButton;
-import com.google.android.material.snackbar.Snackbar;
 
 import net.ktnx.mobileledger.R;
 import net.ktnx.mobileledger.model.Data;
@@ -34,6 +29,8 @@ import net.ktnx.mobileledger.utils.Colors;
 import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.widget.Toolbar;
 
+import static net.ktnx.mobileledger.utils.Logger.debug;
+
 /**
  * An activity representing a single Profile detail screen. This
  * activity is only used on narrow width devices. On tablet-size devices,
@@ -52,7 +49,7 @@ public class ProfileDetailActivity extends CrashReportingActivity {
             if (profile == null) throw new AssertionError(
                     String.format("Can't get profile " + "(index:%d) from the global list", index));
 
-            Log.d("profiles", String.format("Editing profile %s (%s); hue=%d", profile.getName(),
+            debug("profiles", String.format("Editing profile %s (%s); hue=%d", profile.getName(),
                     profile.getUuid(), profile.getThemeId()));
         }
 
@@ -62,15 +59,6 @@ public class ProfileDetailActivity extends CrashReportingActivity {
         Toolbar toolbar = findViewById(R.id.detail_toolbar);
         setSupportActionBar(toolbar);
 
-        FloatingActionButton fab = findViewById(R.id.fab);
-        fab.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View view) {
-                Snackbar.make(view, "Replace with your own detail action", Snackbar.LENGTH_LONG)
-                        .setAction("Action", null).show();
-            }
-        });
-
         // Show the Up button in the action bar.
         ActionBar actionBar = getSupportActionBar();
         if (actionBar != null) {
@@ -100,8 +88,8 @@ public class ProfileDetailActivity extends CrashReportingActivity {
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
-        Log.d("profiles", "[activity] Creating profile details options menu");
-        mFragment.onCreateOptionsMenu(menu, getMenuInflater());
+        debug("profiles", "[activity] Creating profile details options menu");
+        if (mFragment != null) mFragment.onCreateOptionsMenu(menu, getMenuInflater());
 
         return true;
     }