Search in sources :

Example 1 with ImageLoader

use of com.google.samples.apps.iosched.util.ImageLoader in project iosched by google.

the class ExploreSessionsActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.explore_sessions_act);
    // Transition will be postponed until header image is loaded
    supportPostponeEnterTransition();
    mImageLoader = new ImageLoader(this);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mCollapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    mHeaderImage = (ImageView) findViewById(R.id.header_image);
    mTitle = (TextView) findViewById(R.id.title);
    mFiltersList = (RecyclerView) findViewById(R.id.filters);
    mTimeSlotLayout = findViewById(R.id.timeslot_view);
    mTimeSlotDivider = findViewById(R.id.timeslot_divider);
    TextView timeSlotTextView = (TextView) findViewById(R.id.timeslot);
    ImageButton dismissTimeSlotButton = (ImageButton) findViewById(R.id.close_timeslot);
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_flipped, GravityCompat.END);
    mFragment = (ExploreSessionsFragment) getFragmentManager().findFragmentById(R.id.explore_sessions_frag);
    if (savedInstanceState != null) {
        mTagFilterHolder = savedInstanceState.getParcelable(STATE_FILTER_TAGS);
        mCurrentUri = savedInstanceState.getParcelable(STATE_CURRENT_URI);
    } else if (getIntent() != null) {
        mCurrentUri = getIntent().getData();
    }
    // Build the tag URI
    long[] interval = ScheduleContract.Sessions.getInterval(mCurrentUri);
    if (interval != null) {
        mMode = MODE_TIME_FIT;
        String title = getString(R.string.explore_sessions_time_slot_title, TimeUtils.getDayName(this, UIUtils.startTimeToDayIndex(interval[0])), UIUtils.formatTime(interval[0], this));
        mTitle.setText(title);
        mHeaderImage.setScaleType(ImageView.ScaleType.FIT_CENTER);
        mHeaderImage.setImageResource(R.drawable.ic_hash_io_16_monochrome);
        mTimeSlotLayout.setVisibility(View.VISIBLE);
        mTimeSlotDivider.setVisibility(View.VISIBLE);
        timeSlotTextView.setText(title);
        dismissTimeSlotButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                mTimeSlotLayout.setVisibility(View.GONE);
                mTimeSlotDivider.setVisibility(View.GONE);
                mMode = MODE_EXPLORE;
                mCurrentUri = null;
                reloadFragment();
            }
        });
    } else {
        mMode = MODE_EXPLORE;
    }
    // Add the back button to the toolbar.
    setToolbarAsUp(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            navigateUpOrBack(ExploreSessionsActivity.this, null);
        }
    });
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    // Start loading the tag metadata. This will in turn call the fragment with the
    // correct arguments.
    getLoaderManager().initLoader(TAG_METADATA_TOKEN, null, this);
    // ANALYTICS SCREEN: View the Explore Sessions screen
    // Contains: Nothing (Page name is a constant)
    AnalyticsHelper.sendScreenView(SCREEN_LABEL);
}
Also used : ImageButton(android.widget.ImageButton) TextView(android.widget.TextView) ImageLoader(com.google.samples.apps.iosched.util.ImageLoader) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Example 2 with ImageLoader

use of com.google.samples.apps.iosched.util.ImageLoader in project iosched by google.

the class ExploreIOFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mImageLoader = new ImageLoader(getActivity(), R.drawable.io_logo);
    initPresenter();
}
Also used : ImageLoader(com.google.samples.apps.iosched.util.ImageLoader)

Example 3 with ImageLoader

use of com.google.samples.apps.iosched.util.ImageLoader in project iosched by google.

the class SessionDetailFragment method initViews.

private void initViews() {
    final ViewGroup root = (ViewGroup) getActivity().findViewById(R.id.session_detail_frag);
    mAppBar = (AppBarLayout) root.findViewById(R.id.appbar);
    mCollapsingToolbar = (CollapsingToolbarLayout) mAppBar.findViewById(R.id.collapsing_toolbar);
    mHeaderBox = mAppBar.findViewById(R.id.header_session);
    mToolbar = (Toolbar) mHeaderBox.findViewById(R.id.toolbar);
    mTitle = (TextView) mHeaderBox.findViewById(R.id.session_title);
    mSubtitle = (TextView) mHeaderBox.findViewById(R.id.session_subtitle);
    mPhotoViewContainer = mCollapsingToolbar.findViewById(R.id.session_photo_container);
    mPhotoView = (ImageView) mPhotoViewContainer.findViewById(R.id.session_photo);
    mWatchVideo = (Button) mCollapsingToolbar.findViewById(R.id.watch);
    final ViewGroup details = (ViewGroup) root.findViewById(R.id.details_container);
    mAbstract = (TextView) details.findViewById(R.id.session_abstract);
    mLiveStreamedIndicator = (TextView) details.findViewById(R.id.live_streamed_indicator);
    mRequirements = (TextView) details.findViewById(R.id.session_requirements);
    mTags = (LinearLayout) details.findViewById(R.id.session_tags);
    mExtended = (TextView) details.findViewById(R.id.extended_session_button);
    mTagsContainer = (ViewGroup) details.findViewById(R.id.session_tags_container);
    mAddScheduleFab = (CheckableFloatingActionButton) root.findViewById(R.id.add_schedule_button);
    mImageLoader = new ImageLoader(getContext());
}
Also used : ViewGroup(android.view.ViewGroup) ImageLoader(com.google.samples.apps.iosched.util.ImageLoader)

Example 4 with ImageLoader

use of com.google.samples.apps.iosched.util.ImageLoader in project iosched by google.

the class BaseActivity method onPostCreate.

@Override
protected void onPostCreate(Bundle savedInstanceState) {
    super.onPostCreate(savedInstanceState);
    mAppNavigationViewAsDrawer = new AppNavigationViewAsDrawerImpl(new ImageLoader(this), this);
    mAppNavigationViewAsDrawer.activityReady(this, this, getSelfNavDrawerItem());
    if (getSelfNavDrawerItem() != NavigationItemEnum.INVALID) {
        setToolbarForNavigation();
    }
    trySetupSwipeRefresh();
    View mainContent = findViewById(R.id.main_content);
    if (mainContent != null) {
        mainContent.setAlpha(0);
        mainContent.animate().alpha(1).setDuration(MAIN_CONTENT_FADEIN_DURATION);
    } else {
        LOGW(TAG, "No view with ID main_content to fade in.");
    }
}
Also used : AppNavigationViewAsDrawerImpl(com.google.samples.apps.iosched.navigation.AppNavigationViewAsDrawerImpl) ImageLoader(com.google.samples.apps.iosched.util.ImageLoader) View(android.view.View)

Example 5 with ImageLoader

use of com.google.samples.apps.iosched.util.ImageLoader in project iosched by google.

the class VideoLibraryFilteredActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.video_library_filtered_act);
    mImageLoader = new ImageLoader(this);
    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mCollapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
    mHeaderImage = (ImageView) findViewById(R.id.header_image);
    setTitle(R.string.title_video_library);
    // ANALYTICS SCREEN: View the Filtered Video Library screen
    // Contains: Nothing (Page name is a constant)
    AnalyticsHelper.sendScreenView(SCREEN_LABEL);
    LOGD("Tracker", SCREEN_LABEL);
    // Add the back button to the toolbar.
    setToolbarAsUp(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            navigateUpOrBack(VideoLibraryFilteredActivity.this, null);
        }
    });
}
Also used : ImageLoader(com.google.samples.apps.iosched.util.ImageLoader) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

ImageLoader (com.google.samples.apps.iosched.util.ImageLoader)8 View (android.view.View)4 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)2 Intent (android.content.Intent)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 ViewGroup (android.view.ViewGroup)1 AbsListView (android.widget.AbsListView)1 ImageButton (android.widget.ImageButton)1 SessionFeedbackActivity (com.google.samples.apps.iosched.feedback.SessionFeedbackActivity)1 ScheduleItem (com.google.samples.apps.iosched.model.ScheduleItem)1 AppNavigationViewAsDrawerImpl (com.google.samples.apps.iosched.navigation.AppNavigationViewAsDrawerImpl)1 Date (java.util.Date)1