Android Open Source - infinitep Month Fragment






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.customcomponents;
//  w  w  w . j a  va  2s.c  o m
import es.daconstenla.infinip.R;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class MonthFragment extends Fragment{
  /**
   * Keys for bundle storage
   */
  private static final String CALENDAR_DAY = "DAY";
  private static final String CALENDAR_MONTH = "MONTH";
  private static final String CALENDAR_YEAR = "YEAR";
  
  /**
   * Variables for class using
   */
  private int month;
  private int year;
  private int day;
    
  public static MonthFragment newInstance(int day, int month, int year) {
    // Instantiate a new fragment
    MonthFragment fragment = new MonthFragment ();

    // Save the parameters
    Bundle bundle = new Bundle();
    bundle.putInt(CALENDAR_DAY, day);
    bundle.putInt(CALENDAR_MONTH, month);
    bundle.putInt(CALENDAR_YEAR, year);
    fragment.setArguments(bundle);
    fragment.setRetainInstance(true);

    return fragment;
  }
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    // Load parameters when the initial creation of the fragment is done
    this.day = (getArguments() != null) ? getArguments().getInt(
        CALENDAR_DAY) : -1;
    this.month = (getArguments() != null) ? getArguments().getInt(
        CALENDAR_MONTH)
        : 0;
    this.year = (getArguments() != null) ? getArguments().getInt(
        CALENDAR_YEAR)
        : 0;
  }
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {

    ViewGroup rootView = (ViewGroup) inflater.inflate(es.daconstenla.infinip.R.layout.fragment_month, container, false);


//    TextView tvIndex = (TextView) rootView.findViewById(es.daconstenla.infinip.R.id.tvIndex);
//    tvIndex.setText(String.valueOf(this.index));
    MonthView monthV = (MonthView) rootView.findViewById(es.daconstenla.infinip.R.id.monthView);
    monthV.setDate(day, month, year);
    monthV.randomFillCalendar();
    
    // Change the background color
    rootView.setBackgroundColor(getResources().getColor(R.color.customGreyLight1));

    return rootView;

  }
  
}




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