Android Open Source - ponyville-live-android Debug Ui Module






From Project

Back to project page ponyville-live-android.

License

The source code is released under:

Apache License

If you think the Android project ponyville-live-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ponyvillelive.app.ui;
/*  www  .  j a v a2 s .  co m*/
import android.content.SharedPreferences;

import com.ponyvillelive.app.prefs.AnimationSpeed;
import com.ponyvillelive.app.prefs.BooleanPreference;
import com.ponyvillelive.app.prefs.IntPreference;
import com.ponyvillelive.app.prefs.PicassoDebugging;
import com.ponyvillelive.app.prefs.PixelGridEnabled;
import com.ponyvillelive.app.prefs.PixelRatioEnabled;
import com.ponyvillelive.app.prefs.ScalpelEnabled;
import com.ponyvillelive.app.prefs.ScalpelWireframeEnabled;
import com.ponyvillelive.app.prefs.SeenDebugDrawer;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Provides injector for the debug UI functions
 */
@Module(
        injects = {
                MainActivity.class,
                DebugAppContainer.class
        },
        complete = false,
        library = true,
        overrides = true
)
public class DebugUiModule {
    private static final int DEFAULT_ANIMATION_SPEED = 1; // 1x (normal) speed.
    private static final boolean DEFAULT_PICASSO_DEBUGGING = false; // Debug indicators displayed
    private static final boolean DEFAULT_PIXEL_GRID_ENABLED = false; // No pixel grid overlay.
    private static final boolean DEFAULT_PIXEL_RATIO_ENABLED = false; // No pixel ratio overlay.
    private static final boolean DEFAULT_SCALPEL_ENABLED = false; // No crazy 3D view tree.
    private static final boolean DEFAULT_SCALPEL_WIREFRAME_ENABLED = false; // Draw views by default.
    private static final boolean DEFAULT_SEEN_DEBUG_DRAWER = false; // Show debug drawer first time.

    @Provides
    @Singleton
    AppContainer provideAppContainer(DebugAppContainer appContainer) {
        return appContainer;
    }

    @Provides
    @Singleton
    @AnimationSpeed
    IntPreference provideAnimationSpeed(SharedPreferences preferences) {
        return new IntPreference(preferences, "debug_animation_speed", DEFAULT_ANIMATION_SPEED);
    }

    @Provides
    @Singleton
    @PicassoDebugging
    BooleanPreference providePicassoDebugging(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_picasso_debugging", DEFAULT_PICASSO_DEBUGGING);
    }

    @Provides
    @Singleton
    @PixelGridEnabled
    BooleanPreference providePixelGridEnabled(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_pixel_grid_enabled",
                DEFAULT_PIXEL_GRID_ENABLED);
    }

    @Provides
    @Singleton
    @PixelRatioEnabled
    BooleanPreference providePixelRatioEnabled(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_pixel_ratio_enabled",
                DEFAULT_PIXEL_RATIO_ENABLED);
    }

    @Provides
    @Singleton
    @SeenDebugDrawer
    BooleanPreference provideSeenDebugDrawer(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_seen_debug_drawer", DEFAULT_SEEN_DEBUG_DRAWER);
    }

    @Provides
    @Singleton
    @ScalpelEnabled
    BooleanPreference provideScalpelEnabled(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_scalpel_enabled", DEFAULT_SCALPEL_ENABLED);
    }

    @Provides
    @Singleton
    @ScalpelWireframeEnabled
    BooleanPreference provideScalpelWireframeEnabled(SharedPreferences preferences) {
        return new BooleanPreference(preferences, "debug_scalpel_wireframe_drawer",
                DEFAULT_SCALPEL_WIREFRAME_ENABLED);
    }
}




Java Source Code List

com.ponyvillelive.app.DebugPvlModule.java
com.ponyvillelive.app.Modules.java
com.ponyvillelive.app.Modules.java
com.ponyvillelive.app.PvlApp.java
com.ponyvillelive.app.PvlModule.java
com.ponyvillelive.app.model.ArrayResponse.java
com.ponyvillelive.app.model.DebugData.java
com.ponyvillelive.app.model.Entity.java
com.ponyvillelive.app.model.MapResponse.java
com.ponyvillelive.app.model.NowPlayingMeta.java
com.ponyvillelive.app.model.ObjectResponse.java
com.ponyvillelive.app.model.Show.java
com.ponyvillelive.app.model.SongWrapper.java
com.ponyvillelive.app.model.Song.java
com.ponyvillelive.app.model.StationMeta.java
com.ponyvillelive.app.model.Station.java
com.ponyvillelive.app.net.API.java
com.ponyvillelive.app.net.DebugNetModule.java
com.ponyvillelive.app.net.MockAPI.java
com.ponyvillelive.app.net.NetModule.java
com.ponyvillelive.app.prefs.AnimationSpeed.java
com.ponyvillelive.app.prefs.ApiEndpoint.java
com.ponyvillelive.app.prefs.ApiEndpoints.java
com.ponyvillelive.app.prefs.BooleanPreference.java
com.ponyvillelive.app.prefs.Endpoint.java
com.ponyvillelive.app.prefs.Endpoints.java
com.ponyvillelive.app.prefs.IntPreference.java
com.ponyvillelive.app.prefs.IsMockMode.java
com.ponyvillelive.app.prefs.MockDownloader.java
com.ponyvillelive.app.prefs.NetworkProxy.java
com.ponyvillelive.app.prefs.ObjectPreference.java
com.ponyvillelive.app.prefs.PicassoDebugging.java
com.ponyvillelive.app.prefs.PixelGridEnabled.java
com.ponyvillelive.app.prefs.PixelRatioEnabled.java
com.ponyvillelive.app.prefs.ScalpelEnabled.java
com.ponyvillelive.app.prefs.ScalpelWireframeEnabled.java
com.ponyvillelive.app.prefs.SeenDebugDrawer.java
com.ponyvillelive.app.prefs.StringPreference.java
com.ponyvillelive.app.ui.ActionbarHideSlidePanelListener.java
com.ponyvillelive.app.ui.ActivityHierarchyServer.java
com.ponyvillelive.app.ui.AnimationSpeedAdapter.java
com.ponyvillelive.app.ui.AppContainer.java
com.ponyvillelive.app.ui.BindableAdapter.java
com.ponyvillelive.app.ui.BottomDrawerFragment.java
com.ponyvillelive.app.ui.DebugAppContainer.java
com.ponyvillelive.app.ui.DebugUiModule.java
com.ponyvillelive.app.ui.EnumAdapter.java
com.ponyvillelive.app.ui.HierarchyTreeChangeListener.java
com.ponyvillelive.app.ui.MainActivity.java
com.ponyvillelive.app.ui.NetworkDelayAdapter.java
com.ponyvillelive.app.ui.NetworkErrorAdapter.java
com.ponyvillelive.app.ui.NetworkVarianceAdapter.java
com.ponyvillelive.app.ui.ProxyAdapter.java
com.ponyvillelive.app.ui.ServerEndpointAdapter.java
com.ponyvillelive.app.ui.SocketActivityHierarchyServer.java
com.ponyvillelive.app.ui.StationAdapter.java
com.ponyvillelive.app.ui.StationFragment.java
com.ponyvillelive.app.ui.TrackListAdapter.java
com.ponyvillelive.app.ui.UiModule.java
com.ponyvillelive.app.util.Strings.java