<commit_before>package com.ghisguth.sun;

import android.content.Context;
import android.content.SharedPreferences;
import com.ghisguth.wallpaper.GLES20WallpaperService;
import com.ghisguth.wallpaper.glwallpaperservice.GLWallpaperService;

public class Wallpaper extends GLES20WallpaperService {
    public static final String SHARED_PREF_NAME = "SunSettings";
    private static final boolean DEBUG = false;
    private static String TAG = "Sunlight";

    @Override
    public Engine onCreateEngine() {
        return new WallpaperEngine(this, this.getSharedPreferences(SHARED_PREF_NAME,
                Context.MODE_PRIVATE));
    }

    class WallpaperEngine extends GLWallpaperService.GLEngine {
        public WallpaperEngine(Context context, SharedPreferences preferences) {
            super();

            setEGLContextFactory(new ContextFactory());
            setEGLConfigChooser(new ConfigChooser(5, 6, 5, 0, 16, 0));

            SunRenderer renderer = new SunRenderer(context);
            renderer.setSharedPreferences(preferences);
            setRenderer(renderer);
            setRenderMode(RENDERMODE_CONTINUOUSLY);
        }
    }
}<commit_msg>doubletap support. thanks to <NAME><commit_after>package com.ghisguth.sun;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import com.ghisguth.wallpaper.GLES20WallpaperService;
import com.ghisguth.wallpaper.glwallpaperservice.GLWallpaperService;

public class Wallpaper extends GLES20WallpaperService {
    public static final String SHARED_PREF_NAME = "SunSettings";
    private static final boolean DEBUG = false;
    private static String TAG = "Sunlight";
    private long lastTap = 0;

    @Override
    public Engine onCreateEngine() {
        return new WallpaperEngine(this, this.getSharedPreferences(SHARED_PREF_NAME,
                Context.MODE_PRIVATE));
    }

    class WallpaperEngine extends GLWallpaperService.GLEngine {
        public WallpaperEngine(Context context, SharedPreferences preferences) {
            super();

            setEGLContextFactory(new ContextFactory());
            setEGLConfigChooser(new ConfigChooser(5, 6, 5, 0, 16, 0));

            SunRenderer renderer = new SunRenderer(context);
            renderer.setSharedPreferences(preferences);
            setRenderer(renderer);
            setRenderMode(RENDERMODE_CONTINUOUSLY);
        }


        public Bundle onCommand(java.lang.String action, int x, int y, int z,
                                android.os.Bundle extras, boolean resultRequested){
            Intent myIntent = new Intent();

            long currentTime = System.currentTimeMillis();
            if ((currentTime - lastTap) > 500) {
                lastTap = currentTime;
            } else { //this is a valid doubletap
                String appPackageName = getApplicationContext().getPackageName();
                try {
                    myIntent.setClassName(appPackageName, "com.ghisguth.sun.WallpaperSettings");
                    myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(myIntent);
                } catch (ActivityNotFoundException e) {
                    e.printStackTrace();
                }
            }
            return null;
        }
    }
}
{'fraction_non_alphanumeric': 0.07705986959098993, 'fraction_numerical': 0.007705986959098993, 'mean_word_length': 2.7416851441241685, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1997149', 'n_tokens_mistral': 929, 'n_tokens_neox': 867, 'n_words': 195}