// Path: wear/src/main/java/ooo/oxo/apps/earth/provider/EarthsContract.java
// public class EarthsContract {
// 
//     public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder()
//             .scheme(ContentResolver.SCHEME_CONTENT)
//             .authority(AUTHORITY)
//             .path("earths")
//             .build();
// 
//     public static final Uri LATEST_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "latest");
// 
//     public static final String CONTENT_TYPE_DIR
//             = "vnd.android.cursor.dir/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final String CONTENT_TYPE_ITEM
//             = "vnd.android.cursor.item/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     static final String TABLE = "earths";
// 
//     public static class Columns implements BaseColumns {
//         public static final String FILE = "file";
//         public static final String FETCHED_AT = "fetched_at";
//     }
// 
// }


import android.view.SurfaceHolder;
import android.view.WindowInsets;
import androidx.annotation.Nullable;
import java.io.FileNotFoundException;
import ooo.oxo.apps.earth.provider.EarthsContract;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.support.wearable.watchface.WatchFaceStyle;
import android.util.Log;
import android.view.Gravity;
                        .build());
            } else {
                inset = getResources().getDimensionPixelOffset(R.dimen.padding_square);
                setWatchFaceStyle(new WatchFaceStyle.Builder(EarthWatchFaceService.this)
                        .setHotwordIndicatorGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM)
                        .setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT)
                        .setShowSystemUiTime(true)
                        .setShowUnreadCountIndicator(true)
                        .setStatusBarGravity(Gravity.END | Gravity.TOP)
                        .setViewProtectionMode(WatchFaceStyle.PROTECT_HOTWORD_INDICATOR
                                | WatchFaceStyle.PROTECT_STATUS_BAR)
                        .build());
            }
        }

        @Override
        public void onAmbientModeChanged(boolean inAmbientMode) {
            if (ambient != inAmbientMode) {
                ambient = inAmbientMode;
                paint.setColorFilter(ambient ? ambientFilter : null);
                invalidate();
            }
        }

        @Override
        public void onVisibilityChanged(boolean visible) {
            super.onVisibilityChanged(visible);
            if (visible) {
                invalidate();
                getContentResolver().registerContentObserver(
// Path: wear/src/main/java/ooo/oxo/apps/earth/provider/EarthsContract.java
// public class EarthsContract {
// 
//     public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final Uri CONTENT_URI = new Uri.Builder()
//             .scheme(ContentResolver.SCHEME_CONTENT)
//             .authority(AUTHORITY)
//             .path("earths")
//             .build();
// 
//     public static final Uri LATEST_CONTENT_URI = Uri.withAppendedPath(CONTENT_URI, "latest");
// 
//     public static final String CONTENT_TYPE_DIR
//             = "vnd.android.cursor.dir/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     public static final String CONTENT_TYPE_ITEM
//             = "vnd.android.cursor.item/vnd." + BuildConfig.APPLICATION_ID + ".earths";
// 
//     static final String TABLE = "earths";
// 
//     public static class Columns implements BaseColumns {
//         public static final String FILE = "file";
//         public static final String FETCHED_AT = "fetched_at";
//     }
// 
// }


// Path: wear/src/main/java/ooo/oxo/apps/earth/EarthWatchFaceService.java
import android.view.SurfaceHolder;
import android.view.WindowInsets;
import androidx.annotation.Nullable;
import java.io.FileNotFoundException;
import ooo.oxo.apps.earth.provider.EarthsContract;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
import android.support.wearable.watchface.CanvasWatchFaceService;
import android.support.wearable.watchface.WatchFaceStyle;
import android.util.Log;
import android.view.Gravity;

                        .build());
            } else {
                inset = getResources().getDimensionPixelOffset(R.dimen.padding_square);
                setWatchFaceStyle(new WatchFaceStyle.Builder(EarthWatchFaceService.this)
                        .setHotwordIndicatorGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM)
                        .setPeekOpacityMode(WatchFaceStyle.PEEK_OPACITY_MODE_TRANSLUCENT)
                        .setShowSystemUiTime(true)
                        .setShowUnreadCountIndicator(true)
                        .setStatusBarGravity(Gravity.END | Gravity.TOP)
                        .setViewProtectionMode(WatchFaceStyle.PROTECT_HOTWORD_INDICATOR
                                | WatchFaceStyle.PROTECT_STATUS_BAR)
                        .build());
            }
        }

        @Override
        public void onAmbientModeChanged(boolean inAmbientMode) {
            if (ambient != inAmbientMode) {
                ambient = inAmbientMode;
                paint.setColorFilter(ambient ? ambientFilter : null);
                invalidate();
            }
        }

        @Override
        public void onVisibilityChanged(boolean visible) {
            super.onVisibilityChanged(visible);
            if (visible) {
                invalidate();
                getContentResolver().registerContentObserver(
                        EarthsContract.LATEST_CONTENT_URI, false, observer);