Android Open Source - app_list_widget Settings Activity






From Project

Back to project page app_list_widget.

License

The source code is released under:

Apache License

If you think the Android project app_list_widget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2013 acbelter/*from ww w.  java 2 s  .  c  om*/
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.acbelter.applistwidget.ui;

import android.app.Activity;
import android.appwidget.AppWidgetManager;
import android.os.Bundle;
import android.text.util.Linkify;
import android.text.util.Linkify.TransformFilter;
import android.widget.TextView;
import com.acbelter.applistwidget.R;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SettingsActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);

        TextView rateHint = (TextView) findViewById(R.id.rate_hint);
        TransformFilter filter = new TransformFilter() {
            @Override
            public final String transformUrl(final Matcher match, String url) {
                return "";
            }
        };

        Linkify.addLinks(rateHint, Pattern.compile("(Google Play)"),
                "https://play.google.com/store/apps/details?id=com.acbelter.applistwidget",
                null, filter);

        int widgetId = getIntent().getIntExtra(ConfigActivity.KEY_WIDGET_ID,
                AppWidgetManager.INVALID_APPWIDGET_ID);
        boolean isLargeWidget =
                getIntent().getBooleanExtra(ConfigActivity.KEY_WIDGET_LARGE_FLAG, false);

        SettingsFragment frag = new SettingsFragment();
        Bundle args = new Bundle();
        args.putInt(ConfigActivity.KEY_WIDGET_ID, widgetId);
        args.putBoolean(ConfigActivity.KEY_WIDGET_LARGE_FLAG, isLargeWidget);
        frag.setArguments(args);

        getFragmentManager().beginTransaction().replace(R.id.pref_frame, frag).commit();
    }
}




Java Source Code List

com.acbelter.applistwidget.ui.AppItem.java
com.acbelter.applistwidget.ui.AppListOrderAdapter.java
com.acbelter.applistwidget.ui.AppListSelectAdapter.java
com.acbelter.applistwidget.ui.AppOrderFragment.java
com.acbelter.applistwidget.ui.AppSelectFragment.java
com.acbelter.applistwidget.ui.ConfigActivity.java
com.acbelter.applistwidget.ui.SeekBarPreference.java
com.acbelter.applistwidget.ui.SettingsActivity.java
com.acbelter.applistwidget.ui.SettingsFragment.java
com.acbelter.applistwidget.widget.AppListLargeWidgetProvider.java
com.acbelter.applistwidget.widget.AppListWidgetFactory.java
com.acbelter.applistwidget.widget.AppListWidgetProvider.java
com.acbelter.applistwidget.widget.AppListWidgetService.java
com.acbelter.applistwidget.widget.Pref.java