Java Code Examples for com.eveningoutpost.dexdrip.Home#SHOWCASE_MDNS

The following examples show how to use com.eveningoutpost.dexdrip.Home#SHOWCASE_MDNS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Mdns.java    From xDrip with GNU General Public License v3.0 5 votes vote down vote up
private static void startupInfo(Context context) {

        if (MegaStatus.runnableView == null) return;
        if (JoH.quietratelimit("mdns-showcase", 60)) {
            final boolean oneshot = true;
            final int option = Home.SHOWCASE_MDNS;
            if ((oneshot) && (ShotStateStore.hasShot(option))) return;

            // This could do with being in a utility static method also used in Home
            final int size1 = 200;
            final int size2 = 70;
            final String title = "Tap to add or remove";
            final String message = "Devices discovered on the local network can be added or removed as collectors by tapping on them.";
            final ViewTarget target = new ViewTarget(MegaStatus.runnableView);
            final Activity activity = (Activity) context;

            JoH.runOnUiThreadDelayed(new Runnable() {
                                         @Override
                                         public void run() {
                                             final ShowcaseView myShowcase = new ShowcaseView.Builder(activity)

                                                     .setTarget(target)
                                                     .setStyle(R.style.CustomShowcaseTheme2)
                                                     .setContentTitle(title)
                                                     .setContentText("\n" + message)
                                                     .setShowcaseDrawer(new JamorhamShowcaseDrawer(activity.getResources(), activity.getTheme(), size1, size2, 255))
                                                     .singleShot(oneshot ? option : -1)
                                                     .build();
                                             myShowcase.setBackgroundColor(Color.TRANSPARENT);
                                             myShowcase.setShouldCentreText(false);
                                             myShowcase.setBlocksTouches(true);
                                             myShowcase.show();
                                         }
                                     }
                    , 10);
        }
    }
 
Example 2
Source File: Mdns.java    From xDrip-plus with GNU General Public License v3.0 5 votes vote down vote up
private static void startupInfo(Context context) {

        if (MegaStatus.runnableView == null) return;
        if (JoH.quietratelimit("mdns-showcase", 60)) {
            final boolean oneshot = true;
            final int option = Home.SHOWCASE_MDNS;
            if ((oneshot) && (ShotStateStore.hasShot(option))) return;

            // This could do with being in a utility static method also used in Home
            final int size1 = 200;
            final int size2 = 70;
            final String title = "Tap to add or remove";
            final String message = "Devices discovered on the local network can be added or removed as collectors by tapping on them.";
            final ViewTarget target = new ViewTarget(MegaStatus.runnableView);
            final Activity activity = (Activity) context;

            JoH.runOnUiThreadDelayed(new Runnable() {
                                         @Override
                                         public void run() {
                                             final ShowcaseView myShowcase = new ShowcaseView.Builder(activity)

                                                     .setTarget(target)
                                                     .setStyle(R.style.CustomShowcaseTheme2)
                                                     .setContentTitle(title)
                                                     .setContentText("\n" + message)
                                                     .setShowcaseDrawer(new JamorhamShowcaseDrawer(activity.getResources(), activity.getTheme(), size1, size2, 255))
                                                     .singleShot(oneshot ? option : -1)
                                                     .build();
                                             myShowcase.setBackgroundColor(Color.TRANSPARENT);
                                             myShowcase.setShouldCentreText(false);
                                             myShowcase.setBlocksTouches(true);
                                             myShowcase.show();
                                         }
                                     }
                    , 10);
        }
    }