Android Open Source - Reader Entry Activity






From Project

Back to project page Reader.

License

The source code is released under:

GNU General Public License

If you think the Android project Reader 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

/**
 * Flym//from w  w w. j ava  2  s .c  o  m
 *
 * Copyright (c) 2012-2013 Frederic Julian
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU General Public License as published by
 *     the Free Software Foundation, either version 3 of the License, or
 *     (at your option) any later version.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.carlrice.reader.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;

import com.carlrice.reader.Constants;
import com.carlrice.reader.R;
import com.carlrice.reader.fragment.EntryFragment;
import com.carlrice.reader.utils.PrefUtils;
import com.carlrice.reader.utils.UiUtils;

public class EntryActivity extends BaseActivity {

    private EntryFragment mEntryFragment;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        UiUtils.setPreferenceTheme(this);
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_entry);

        mEntryFragment = (EntryFragment) getFragmentManager().findFragmentById(R.id.entry_fragment);
        if (savedInstanceState == null) { // Put the data only the first time (the fragment will save its state)
            mEntryFragment.setData(getIntent().getData());
        }

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        if (PrefUtils.getBoolean(PrefUtils.DISPLAY_ENTRIES_FULLSCREEN, false)) {
            setImmersiveFullScreen(true);
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == android.R.id.home) {
            Bundle b = getIntent().getExtras();
            if (b != null && b.getBoolean(Constants.INTENT_FROM_WIDGET, false)) {
                Intent intent = new Intent(this, HomeActivity.class);
                startActivity(intent);
            }
            finish();
            return true;
        }

        return false;
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);

        mEntryFragment.setData(intent.getData());
    }
}




Java Source Code List

com.carlrice.reader.Application.java
com.carlrice.reader.Constants.java
com.carlrice.reader.activity.AboutActivity.java
com.carlrice.reader.activity.AddGoogleNewsActivity.java
com.carlrice.reader.activity.BaseActivity.java
com.carlrice.reader.activity.EditFeedActivity.java
com.carlrice.reader.activity.EditFeedsListActivity.java
com.carlrice.reader.activity.EntryActivity.java
com.carlrice.reader.activity.GeneralPrefsActivity.java
com.carlrice.reader.activity.HomeActivity.java
com.carlrice.reader.adapter.CursorLoaderExpandableListAdapter.java
com.carlrice.reader.adapter.DrawerAdapter.java
com.carlrice.reader.adapter.EntriesCursorAdapter.java
com.carlrice.reader.adapter.FeedsCursorAdapter.java
com.carlrice.reader.adapter.FiltersCursorAdapter.java
com.carlrice.reader.fragment.EditFeedsListFragment.java
com.carlrice.reader.fragment.EntriesListFragment.java
com.carlrice.reader.fragment.EntryFragment.java
com.carlrice.reader.fragment.GeneralPrefsFragment.java
com.carlrice.reader.fragment.SwipeRefreshFragment.java
com.carlrice.reader.fragment.SwipeRefreshListFragment.java
com.carlrice.reader.loader.BaseLoader.java
com.carlrice.reader.parser.OPML.java
com.carlrice.reader.parser.RssAtomParser.java
com.carlrice.reader.provider.DatabaseHelper.java
com.carlrice.reader.provider.FeedDataContentProvider.java
com.carlrice.reader.provider.FeedData.java
com.carlrice.reader.receiver.BootCompletedBroadcastReceiver.java
com.carlrice.reader.receiver.ConnectionChangeReceiver.java
com.carlrice.reader.service.FetcherService.java
com.carlrice.reader.service.RefreshService.java
com.carlrice.reader.utils.ArticleTextExtractor.java
com.carlrice.reader.utils.CircleTransform.java
com.carlrice.reader.utils.FileUtils.java
com.carlrice.reader.utils.HtmlUtils.java
com.carlrice.reader.utils.NetworkUtils.java
com.carlrice.reader.utils.PrefUtils.java
com.carlrice.reader.utils.StringUtils.java
com.carlrice.reader.utils.ThrottledContentObserver.java
com.carlrice.reader.utils.UiUtils.java
com.carlrice.reader.view.AutoSummaryListPreference.java
com.carlrice.reader.view.BakedBezierInterpolator.java
com.carlrice.reader.view.DragNDropExpandableListView.java
com.carlrice.reader.view.DragNDropListener.java
com.carlrice.reader.view.EntryView.java
com.carlrice.reader.view.SwipeProgressBar.java
com.carlrice.reader.view.SwipeRefreshLayout.java
com.carlrice.reader.widget.ColorPickerDialogPreference.java
com.carlrice.reader.widget.TickerWidgetProvider.java
com.carlrice.reader.widget.TickerWidgetService.java
com.carlrice.reader.widget.WidgetConfigActivity.java
com.carlrice.reader.widget.WidgetConfigFragment.java
com.carlrice.reader.widget.WidgetProvider.java
com.carlrice.reader.widget.WidgetService.java