el="diff-813cd3b460fae0135be638f977b9af6f24cc7c53L18">18
-import android.content.Context;
19
-import android.content.SharedPreferences;
20
-
21
-public class AppSettings {
22
-
23
-    private final SharedPreferences prefs;
24
-
25
-    public AppSettings(Context context) {
26
-        prefs = context.getSharedPreferences("app_settings", Context.MODE_PRIVATE);
27
-    }
28
-
29
-    public boolean showChangelog(int nextNumber) {
30
-        int last = prefs.getInt("internal.last_changelog_number", -1);
31
-        if (last == -1 || nextNumber > last) {
32
-            prefs.edit().putInt("internal.last_changelog_number", nextNumber).apply();
33
-        }
34
-        return last != -1 && nextNumber > last;
35
-    }
36
-
37
-    public boolean isGalleryOrderReversed() {
38
-        return prefs.getBoolean("internal.gallery.reverse_order", false);
39
-    }
40
-
41
-    public void setGalleryOrderReversed(boolean reversed) {
42
-        prefs.edit().putBoolean("internal.gallery.reverse_order", reversed).apply();
43
-    }
44
-
45
-    public int getShowCapturedPictureDuration() {
46
-        return getIntFromStringPreference("liveview.captured_picture_duration", -1);
47
-    }
48
-
49
-    public boolean isShowCapturedPictureNever() {
50
-        return getShowCapturedPictureDuration() == -2;
51
-    }
52
-
53
-    public boolean isShowCapturedPictureDurationManual() {
54
-        return getShowCapturedPictureDuration() == -1;
55
-    }
56
-
57
-    public int getNumPicturesInStream() {
58
-        return getIntFromStringPreference("picturestream.num_pictures", 6);
59
-    }
60
-
61
-    public boolean isShowFilenameInStream() {
62
-        return prefs.getBoolean("picturestream.show_filename", true);
63
-    }
64
-
65
-    public int getCapturedPictureSampleSize() {
66
-        return getIntFromStringPreference("memory.picture_sample_size", 2);
67
-    }
68
-
69
-    private int getIntFromStringPreference(String key, int defaultValue) {
70
-        try {
71
-            String value = prefs.getString(key, null);
72
-            if (value != null) {
73
-                return Integer.parseInt(value);
74
-            }
75
-        } catch (NumberFormatException e) {
76
-            // nop
77
-        }
78
-        return defaultValue;
79
-    }
80
-}

adminSystem - Gogs: Go Git Service

No Description

readme.md 567B

shebang-command Build Status

Get the command from a shebang

Install

$ npm install --save shebang-command

Usage

const shebangCommand = require('shebang-command');

shebangCommand('#!/usr/bin/env node');
//=> 'node'

shebangCommand('#!/bin/bash');
//=> 'bash'

API

shebangCommand(string)

string

Type: string

String containing a shebang.

License

MIT © Kevin Martensson