Android Open Source - infinitep Calendar Activity






From Project

Back to project page infinitep.

License

The source code is released under:

Apache License

If you think the Android project infinitep 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 es.daconstenla.infinip.activity;
//from  ww w.  j  a  va2s .c  o m
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import es.daconstenla.infinip.R;
import es.daconstenla.infinip.customcomponents.MonthFragmentTest;
import es.daconstenla.infinip.customcomponents.MyFragmentMonthAdapter;

//TODO aadiendo el fragment adapter pero nah, es old way, habr algo nuevo
// Tabfragment?
public class CalendarActivity  extends FragmentActivity {
  /**
   * The pager widget, which handles animation and allows swiping horizontally
   * to access previous and next pages.
   */
  ViewPager pager = null;

  /**
   * The pager adapter, which provides the pages to the view pager widget.
   */
  MyFragmentMonthAdapter pagerAdapter;

  @Override
  protected void onCreate(Bundle arg0) {
    super.onCreate(arg0);
    this.setContentView(R.layout.fragment_viewpager);

    // Instantiate a ViewPager
    this.pager = (ViewPager) this.findViewById(R.id.pager);

    // Create an adapter with the fragments we show on the ViewPager
    MyFragmentMonthAdapter adapter = new MyFragmentMonthAdapter(
        getSupportFragmentManager());
    
    /*adapter.addFragment(MonthFragmentTest.newInstance(getResources()
        .getColor(R.color.activityLighterOrange), 0));
    adapter.addFragment(MonthFragmentTest.newInstance(getResources()
        .getColor(R.color.activityLightBlue), 1));
    adapter.addFragment(MonthFragmentTest.newInstance(getResources()
        .getColor(R.color.activityLightGreen), 2));
    adapter.addFragment(MonthFragmentTest.newInstance(getResources()
        .getColor(R.color.activityLighterRed), 3));*/
    
    
    
    this.pager.setAdapter(adapter);

  }

  @Override
  public void onBackPressed() {

    // Return to previous page when we press back button
    if (this.pager.getCurrentItem() == 0)
      super.onBackPressed();
    else
      this.pager.setCurrentItem(this.pager.getCurrentItem() - 1);

  }
  /*
  @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.activity_calendar);
        
        
        MonthView cal = (MonthView) this.findViewById(R.id.calenda1);
        cal.setYear(2014);
        cal.setDay(12);
        cal.setMonth(1);
        
        cal.randomFillCalendar();
        
        cal.setOnTouchListener(new OnSwipeTouchListener(this) {
          @Override
            public void onSwipeTop() {
                Toast.makeText(CalendarActivity.this, "top", Toast.LENGTH_SHORT).show();
            }
          @Override
            public void onSwipeRight() {
                Toast.makeText(CalendarActivity.this, "right", Toast.LENGTH_SHORT).show();
            }
          @Override
            public void onSwipeLeft() {
                Toast.makeText(CalendarActivity.this, "left", Toast.LENGTH_SHORT).show();
            }
          @Override
            public void onSwipeBottom() {
                Toast.makeText(CalendarActivity.this, "bottom", Toast.LENGTH_SHORT).show();
            }
          @Override
          public boolean onTouch(View v, MotionEvent event) {
              return gestureDetector.onTouchEvent(event);
          }
        });
  }*/

/*

  @Override
  public android.support.v4.app.Fragment getItem(int arg0) {
    // TODO Auto-generated method stub
    return null;
  }



  @Override
  public int getCount() {
    // TODO Auto-generated method stub
    return 0;
  }*/
  
}




Java Source Code List

com.example.databasetest.FullscreenActivity.java
com.example.databasetest.util.SystemUiHiderBase.java
com.example.databasetest.util.SystemUiHiderHoneycomb.java
com.example.databasetest.util.SystemUiHider.java
com.example.datatest.MainActivity.java
com.example.datatest.database.InfinitepHelper.java
com.example.datatest.database.MovementRaw.java
com.example.datatest.database.MovementSummary.java
com.example.datatest.database.TableMovementRaw.java
com.example.datatest.database.TableMovementSummary.java
com.example.datatest.databaseTest.DatabaseTester.java
com.example.datatest.util.Utils.java
es.daconstenla.infinip.activity.CalendarActivity.java
es.daconstenla.infinip.activity.DayActivity.java
es.daconstenla.infinip.activity.MainActivity.java
es.daconstenla.infinip.activity.RangeActivity.java
es.daconstenla.infinip.activity.SettingsActivity.java
es.daconstenla.infinip.activity.SplashActivity.java
es.daconstenla.infinip.activity.SyncActivity.java
es.daconstenla.infinip.customcomponents.HorizontalGraph.java
es.daconstenla.infinip.customcomponents.InformationBox.java
es.daconstenla.infinip.customcomponents.MonthFragmentTest.java
es.daconstenla.infinip.customcomponents.MonthFragment.java
es.daconstenla.infinip.customcomponents.MonthView.java
es.daconstenla.infinip.customcomponents.MyFragmentMonthAdapter.java
es.daconstenla.infinip.customcomponents.events.OnSwipeTouchListener.java
es.daconstenla.infinip.customcomponents.pieces.ElementBackground.java
es.daconstenla.infinip.customcomponents.pieces.HorGraphBar.java
es.daconstenla.infinip.customcomponents.pieces.ItemCalendarDay.java
es.daconstenla.infinip.customcomponents.pieces.data.BarElementData.java
es.daconstenla.infinip.customcomponents.pieces.data.ColorMyCustom.java
es.daconstenla.infinip.customcomponents.pieces.data.CustomScrollView.java
es.daconstenla.infinip.customcomponents.pieces.data.ItemHorizontalBar.java
es.daconstenla.infinip.database.InfinitepHelper.java
es.daconstenla.infinip.database.MovementRaw.java
es.daconstenla.infinip.database.MovementSummary.java
es.daconstenla.infinip.database.TableMovementRaw.java
es.daconstenla.infinip.database.TableMovementSummary.java
es.daconstenla.infinip.database.utils.Utils.java
es.daconstenla.infinip.unused.AutoResizeTextView.java