Android Open Source - generalsbuzz Event Display Fragment






From Project

Back to project page generalsbuzz.

License

The source code is released under:

MIT License

If you think the Android project generalsbuzz 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 me.kworden.wlcalendar2.fragment;
/*from   w ww . j  a v a 2 s  .c  o m*/
import me.kworden.wlcalendar2.MainActivity;
import me.kworden.wlcalendar2.R;
import me.kworden.wlcalendar2.struct.WLEvent;
import me.kworden.wlcalendar2.util.BROADCAST;

import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

public class EventDisplayFragment extends Fragment
{
  private WLEvent[] m_events;
  private ListView m_listview;
  private View m_root;
  
  @Override
    public void onSaveInstanceState(Bundle p_state)
  {
    if(m_events != null)
      p_state.putParcelableArray("EVENTS", m_events);
  }
  
  @Override
  public View onCreateView(LayoutInflater p_inflater, ViewGroup p_container, Bundle p_prev_state)
  {
    m_root = p_inflater.inflate(R.layout.fragment_main, p_container, false);
    m_listview = (ListView)m_root.findViewById(R.id.main_events);
    return m_root;
  }

  @Override
    public void onActivityCreated(Bundle p_prev_state)
  {
    super.onActivityCreated(p_prev_state);
    
    if(p_prev_state != null && p_prev_state.containsKey("EVENTS"))
      m_events = (WLEvent[])p_prev_state.getParcelableArray("EVENTS");
  }
  
  public int getIndex()
  {
    try
    {
      return m_listview.getFirstVisiblePosition();
    }
    catch(Exception e){ return 0; }
  }
  
  public int getTop()
  {
    try
    {
      return m_listview.getChildAt(0).getTop();
    }
    catch(Exception e){ return 0; }
  }

  public void setEvents(WLEvent[] p_events)
  {
    m_events = p_events;
  }
  
  public WLEvent[] getEvents()
  {
    return m_events;
  }
}




Java Source Code List

me.kworden.wlcalendar2.BuildConfig.java
me.kworden.wlcalendar2.BuildConfig.java
me.kworden.wlcalendar2.MainActivity.java
me.kworden.wlcalendar2.SettingsActivity.java
me.kworden.wlcalendar2.adapter.EventAdapter.java
me.kworden.wlcalendar2.async.CheckLocalDataTask.java
me.kworden.wlcalendar2.async.ParseDataTask.java
me.kworden.wlcalendar2.async.ReadLocalDataTask.java
me.kworden.wlcalendar2.async.RequestRemoteDataTask.java
me.kworden.wlcalendar2.async.StoreDataTask.java
me.kworden.wlcalendar2.fragment.EventDisplayFragment.java
me.kworden.wlcalendar2.fragment.EventInfoFragment.java
me.kworden.wlcalendar2.fragment.SettingsFragment.java
me.kworden.wlcalendar2.receiver.CheckLocalDataReceiver.java
me.kworden.wlcalendar2.receiver.RequestRemoteDataReceiver.java
me.kworden.wlcalendar2.receiver.UpdateRowsReceiver.java
me.kworden.wlcalendar2.struct.MonthYearParcel.java
me.kworden.wlcalendar2.struct.WLEventClassifier.java
me.kworden.wlcalendar2.struct.WLEventLinebreak.java
me.kworden.wlcalendar2.struct.WLEvent.java
me.kworden.wlcalendar2.struct.WLHeader.java
me.kworden.wlcalendar2.util.APP.java
me.kworden.wlcalendar2.util.BROADCAST.java
me.kworden.wlcalendar2.util.MD5.java
me.kworden.wlcalendar2.util.PATTERNS.java
me.kworden.wlcalendar2.util.STATUS.java