Search in sources :

Example 1 with ChangeLog

use of de.cketti.library.changelog.ChangeLog in project k-9 by k9mail.

the class MessageList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {
        finish();
        return;
    }
    if (useSplitView()) {
        setContentView(R.layout.split_message_list);
    } else {
        setContentView(R.layout.message_list);
        mViewSwitcher = (ViewSwitcher) findViewById(R.id.container);
        mViewSwitcher.setFirstInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_left));
        mViewSwitcher.setFirstOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_right));
        mViewSwitcher.setSecondInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_right));
        mViewSwitcher.setSecondOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_left));
        mViewSwitcher.setOnSwitchCompleteListener(this);
    }
    initializeActionBar();
    // Enable gesture detection for MessageLists
    setupGestureDetector(this);
    if (!decodeExtras(getIntent())) {
        return;
    }
    findFragments();
    initializeDisplayMode(savedInstanceState);
    initializeLayout();
    initializeFragments();
    displayViews();
    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
}
Also used : ChangeLog(de.cketti.library.changelog.ChangeLog)

Example 2 with ChangeLog

use of de.cketti.library.changelog.ChangeLog in project k-9 by k9mail.

the class FolderList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (UpgradeDatabases.actionUpgradeDatabases(this, getIntent())) {
        finish();
        return;
    }
    mActionBarProgressView = getActionBarProgressView();
    mActionBar = getActionBar();
    initializeActionBar();
    setContentView(R.layout.folder_list);
    mListView = getListView();
    mListView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    mListView.setLongClickable(true);
    mListView.setFastScrollEnabled(true);
    mListView.setScrollingCacheEnabled(false);
    mListView.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            onOpenFolder(((FolderInfoHolder) mAdapter.getItem(position)).name);
        }
    });
    registerForContextMenu(mListView);
    mListView.setSaveEnabled(true);
    mInflater = getLayoutInflater();
    context = this;
    onNewIntent(getIntent());
    if (isFinishing()) {
        /*
             * onNewIntent() may call finish(), but execution will still continue here.
             * We return now because we don't want to display the changelog which can
             * result in a leaked window error.
             */
        return;
    }
    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) ChangeLog(de.cketti.library.changelog.ChangeLog) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) SearchView(android.widget.SearchView) SuppressLint(android.annotation.SuppressLint)

Example 3 with ChangeLog

use of de.cketti.library.changelog.ChangeLog in project Gadgetbridge by Freeyourgadget.

the class ControlCenterv2 method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    if (GBApplication.isDarkThemeEnabled()) {
        setTheme(R.style.GadgetbridgeThemeDark_NoActionBar);
    } else {
        setTheme(R.style.GadgetbridgeTheme_NoActionBar);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_controlcenterv2);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            launchDiscoveryActivity();
        }
    });
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.controlcenter_navigation_drawer_open, R.string.controlcenter_navigation_drawer_close);
    drawer.setDrawerListener(toggle);
    toggle.syncState();
    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);
    //end of material design boilerplate
    deviceManager = ((GBApplication) getApplication()).getDeviceManager();
    deviceListView = (RecyclerView) findViewById(R.id.deviceListView);
    deviceListView.setHasFixedSize(true);
    deviceListView.setLayoutManager(new LinearLayoutManager(this));
    background = (ImageView) findViewById(R.id.no_items_bg);
    deviceList = deviceManager.getDevices();
    mGBDeviceAdapter = new GBDeviceAdapterv2(this, deviceList);
    deviceListView.setAdapter(this.mGBDeviceAdapter);
    ItemTouchHelper swipeToDismissTouchHelper = new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(ItemTouchHelper.LEFT, ItemTouchHelper.RIGHT) {

        @Override
        public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
            if (dX > 50)
                dX = 50;
            super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
        }

        @Override
        public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
            GB.toast(getBaseContext(), "onMove", Toast.LENGTH_LONG, GB.ERROR);
            return false;
        }

        @Override
        public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
            GB.toast(getBaseContext(), "onSwiped", Toast.LENGTH_LONG, GB.ERROR);
        }

        @Override
        public void onChildDrawOver(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
        }
    });
    //uncomment to enable fixed-swipe to reveal more actions
    //swipeToDismissTouchHelper.attachToRecyclerView(deviceListView);
    registerForContextMenu(deviceListView);
    IntentFilter filterLocal = new IntentFilter();
    filterLocal.addAction(GBApplication.ACTION_QUIT);
    filterLocal.addAction(DeviceManager.ACTION_DEVICES_CHANGED);
    LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal);
    refreshPairedDevices();
    /*
         * Ask for permission to intercept notifications on first run.
         */
    Prefs prefs = GBApplication.getPrefs();
    if (prefs.getBoolean("firstrun", true)) {
        prefs.getPreferences().edit().putBoolean("firstrun", false).apply();
        Intent enableIntent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
        startActivity(enableIntent);
    }
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        checkAndRequestPermissions();
    }
    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
    GBApplication.deviceService().start();
    if (GB.isBluetoothEnabled() && deviceList.isEmpty() && Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
        startActivity(new Intent(this, DiscoveryActivity.class));
    } else {
        GBApplication.deviceService().requestDeviceInfo();
    }
}
Also used : IntentFilter(android.content.IntentFilter) NavigationView(android.support.design.widget.NavigationView) Canvas(android.graphics.Canvas) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) GBDeviceAdapterv2(nodomain.freeyourgadget.gadgetbridge.adapter.GBDeviceAdapterv2) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) Prefs(nodomain.freeyourgadget.gadgetbridge.util.Prefs) NavigationView(android.support.design.widget.NavigationView) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) FloatingActionButton(android.support.design.widget.FloatingActionButton) RecyclerView(android.support.v7.widget.RecyclerView) ChangeLog(de.cketti.library.changelog.ChangeLog) DrawerLayout(android.support.v4.widget.DrawerLayout) Toolbar(android.support.v7.widget.Toolbar)

Example 4 with ChangeLog

use of de.cketti.library.changelog.ChangeLog in project k-9 by k9mail.

the class Accounts method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    if (!K9.isHideSpecialAccounts()) {
        createSpecialAccounts();
    }
    List<Account> accounts = Preferences.getPreferences(this).getAccounts();
    Intent intent = getIntent();
    // see if we should show the welcome message
    if (ACTION_IMPORT_SETTINGS.equals(intent.getAction())) {
        onImport();
    } else if (accounts.size() < 1) {
        WelcomeMessage.showWelcomeMessage(this);
        finish();
        return;
    }
    if (UpgradeDatabases.actionUpgradeDatabases(this, intent)) {
        finish();
        return;
    }
    boolean startup = intent.getBooleanExtra(EXTRA_STARTUP, true);
    if (startup && K9.startIntegratedInbox() && !K9.isHideSpecialAccounts()) {
        onOpenAccount(mUnifiedInboxAccount);
        finish();
        return;
    } else if (startup && accounts.size() == 1 && onOpenAccount(accounts.get(0))) {
        finish();
        return;
    }
    requestWindowFeature(Window.FEATURE_PROGRESS);
    mActionBar = getActionBar();
    initializeActionBar();
    setContentView(R.layout.accounts);
    ListView listView = getListView();
    listView.setOnItemClickListener(this);
    listView.setItemsCanFocus(false);
    listView.setScrollingCacheEnabled(false);
    registerForContextMenu(listView);
    if (icicle != null && icicle.containsKey(SELECTED_CONTEXT_ACCOUNT)) {
        String accountUuid = icicle.getString("selectedContextAccount");
        mSelectedContextAccount = Preferences.getPreferences(this).getAccount(accountUuid);
    }
    restoreAccountStats(icicle);
    mHandler.setViewTitle();
    // Handle activity restarts because of a configuration change (e.g. rotating the screen)
    mNonConfigurationInstance = (NonConfigurationInstance) getLastNonConfigurationInstance();
    if (mNonConfigurationInstance != null) {
        mNonConfigurationInstance.restore(this);
    }
    ChangeLog cl = new ChangeLog(this);
    if (cl.isFirstRun()) {
        cl.getLogDialog().show();
    }
}
Also used : SearchAccount(com.fsck.k9.search.SearchAccount) Account(com.fsck.k9.Account) BaseAccount(com.fsck.k9.BaseAccount) ListView(android.widget.ListView) Intent(android.content.Intent) ChangeLog(de.cketti.library.changelog.ChangeLog)

Example 5 with ChangeLog

use of de.cketti.library.changelog.ChangeLog in project k-9 by k9mail.

the class Accounts method onAbout.

private void onAbout() {
    String appName = getString(R.string.app_name);
    int year = Calendar.getInstance().get(Calendar.YEAR);
    WebView wv = new WebView(this);
    StringBuilder html = new StringBuilder().append("<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />").append("<img src=\"file:///android_asset/icon.png\" alt=\"").append(appName).append("\"/>").append("<h1>").append(String.format(getString(R.string.about_title_fmt), "<a href=\"" + getString(R.string.app_webpage_url)) + "\">").append(appName).append("</a>").append("</h1><p>").append(appName).append(" ").append(String.format(getString(R.string.debug_version_fmt), getVersionNumber())).append("</p><p>").append(String.format(getString(R.string.app_authors_fmt), getString(R.string.app_authors))).append("</p><p>").append(String.format(getString(R.string.app_revision_fmt), "<a href=\"" + getString(R.string.app_revision_url) + "\">" + getString(R.string.app_revision_url) + "</a>")).append("</p><hr/><p>").append(String.format(getString(R.string.app_copyright_fmt), Integer.toString(year), Integer.toString(year))).append("</p><hr/><p>").append(getString(R.string.app_license)).append("</p><hr/><p>");
    StringBuilder libs = new StringBuilder().append("<ul>");
    for (String[] library : USED_LIBRARIES) {
        libs.append("<li><a href=\"").append(library[1]).append("\">").append(library[0]).append("</a></li>");
    }
    libs.append("</ul>");
    html.append(String.format(getString(R.string.app_libraries), libs.toString())).append("</p><hr/><p>").append(String.format(getString(R.string.app_emoji_icons), "<div>TypePad 絵文字アイコン画像 " + "(<a href=\"http://typepad.jp/\">Six Apart Ltd</a>) / " + "<a href=\"http://creativecommons.org/licenses/by/2.1/jp/\">CC BY 2.1</a></div>")).append("</p><hr/><p>").append(getString(R.string.app_htmlcleaner_license));
    wv.loadDataWithBaseURL("file:///android_res/drawable/", html.toString(), "text/html", "utf-8", null);
    new AlertDialog.Builder(this).setView(wv).setCancelable(true).setPositiveButton(R.string.okay_action, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface d, int c) {
            d.dismiss();
        }
    }).setNeutralButton(R.string.changelog_full_title, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface d, int c) {
            new ChangeLog(Accounts.this).getFullLogDialog().show();
        }
    }).show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) OnClickListener(android.view.View.OnClickListener) ChangeLog(de.cketti.library.changelog.ChangeLog) WebView(android.webkit.WebView)

Aggregations

ChangeLog (de.cketti.library.changelog.ChangeLog)6 Intent (android.content.Intent)3 DrawerLayout (android.support.v4.widget.DrawerLayout)2 View (android.view.View)2 ListView (android.widget.ListView)2 SuppressLint (android.annotation.SuppressLint)1 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 IntentFilter (android.content.IntentFilter)1 Canvas (android.graphics.Canvas)1 FloatingActionButton (android.support.design.widget.FloatingActionButton)1 NavigationView (android.support.design.widget.NavigationView)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 Toolbar (android.support.v7.widget.Toolbar)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 OnClickListener (android.view.View.OnClickListener)1 WebView (android.webkit.WebView)1 AdapterView (android.widget.AdapterView)1