Android Open Source - scala1_android Favourites






From Project

Back to project page scala1_android.

License

The source code is released under:

Copyright (c) 2012, Magnetic Bear Studios Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditio...

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

package com.magneticbear.scala1;
/* ww w.j a  v  a  2s.  com*/
import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;

public class Favourites extends Activity {

  Boolean showingEvents = true;
  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_favourites);
        setupButtons();
    }

    @Override
    protected void onResume() 
    {
      refreshFeed();
      super.onResume();
    }
    
    // Dont show the options menu
   @Override
  public boolean onPrepareOptionsMenu(Menu menu) {
    return false;
  }
    
    public void refreshFeed()
    {
      if(showingEvents)
      {
        show_events();
      }
      else
      {
        show_speakers();
      }
    }
    
    public void setupButtons()
    {
      final Button rocker_events   = (Button)findViewById(R.id.rocker_events);
      final Button rocker_speakers = (Button)findViewById(R.id.rocker_speakers);
    
      rocker_events.setOnClickListener(new OnClickListener() 
      {
      @Override
      public void onClick(View v) 
      {
        UserData.mixpanel.track("FavouritesRockerEventPress", null);
        
        rocker_events.setBackgroundResource(R.drawable.fav_tab_left_down);
        rocker_speakers.setBackgroundResource(R.drawable.fav_tab_right_up);
        show_events();
      }
    });
      rocker_speakers.setOnClickListener(new OnClickListener() 
      {  
      @Override
      public void onClick(View v) 
      {
        UserData.mixpanel.track("FavouritesRockerSpeakersPress", null);
        
        rocker_events.setBackgroundResource(R.drawable.fav_tab_left_up);
        rocker_speakers.setBackgroundResource(R.drawable.fav_tab_right_down);
        show_speakers();
      }
    });
    }
    
    public void show_events()
    {
      showingEvents = true;
      ArrayList<Struct_Event> local_event = (ArrayList)UserData.fav_events.clone();
      Struct_Event_Adapter adapter = new Struct_Event_Adapter(getBaseContext(), R.id.struct_event_adapter_row_title, local_event, false, false);
      ((ListView)findViewById(R.id.favourites_list)).setAdapter(adapter);
      
    }
    public void show_speakers()
    {
      showingEvents = false;
      ArrayList<Struct_Speaker> local_speaker = (ArrayList)UserData.fav_speakers.clone();
       Struct_Speaker_Adapter adapter = new Struct_Speaker_Adapter(getBaseContext(), R.id.struct_speaker_adapter_row_title, local_speaker, false, false);
       ((ListView)findViewById(R.id.favourites_list)).setAdapter(adapter);
    }
    
    @Override
    public void onBackPressed() {
      
      UserData.mixpanel.track("FavouritesBack", null);
      
      super.onBackPressed();
    }
}




Java Source Code List

com.koushikdutta.urlimageviewhelper.Constants.java
com.koushikdutta.urlimageviewhelper.DiskLruCache.java
com.koushikdutta.urlimageviewhelper.LruCache.java
com.koushikdutta.urlimageviewhelper.SoftReferenceHashTable.java
com.koushikdutta.urlimageviewhelper.UrlImageCache.java
com.koushikdutta.urlimageviewhelper.UrlImageViewCallback.java
com.koushikdutta.urlimageviewhelper.UrlImageViewHelper.java
com.koushikdutta.urlimageviewhelper.UrlLruCache.java
com.koushikdutta.urlimageviewhelper.WrapperDrawable.java
com.magneticbear.scala1.About.java
com.magneticbear.scala1.EventInfo.java
com.magneticbear.scala1.Events.java
com.magneticbear.scala1.Favourites.java
com.magneticbear.scala1.Home.java
com.magneticbear.scala1.OpenAllSSLSocketFactory.java
com.magneticbear.scala1.Playground.java
com.magneticbear.scala1.ServerData.java
com.magneticbear.scala1.SpeakersInfo.java
com.magneticbear.scala1.Speakers.java
com.magneticbear.scala1.Splash.java
com.magneticbear.scala1.Struct_Event_Adapter.java
com.magneticbear.scala1.Struct_Event.java
com.magneticbear.scala1.Struct_Speaker_Adapter.java
com.magneticbear.scala1.Struct_Speaker.java
com.magneticbear.scala1.UserData.java