当前位置: 首页>>代码示例>>Java>>正文


Java CaldroidFragment类代码示例

本文整理汇总了Java中com.roomorama.caldroid.CaldroidFragment的典型用法代码示例。如果您正苦于以下问题:Java CaldroidFragment类的具体用法?Java CaldroidFragment怎么用?Java CaldroidFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CaldroidFragment类属于com.roomorama.caldroid包,在下文中一共展示了CaldroidFragment类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initCalendar

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void initCalendar(final long foodId, final int recommendedServings) {
    datesWithEvents = new ArrayMap<>();

    caldroid = CaldroidFragment.newInstance("", DateUtil.getCurrentMonthOneBased(), DateUtil.getCurrentYear());

    caldroid.setCaldroidListener(new CaldroidListener() {
        @Override
        public void onSelectDate(Date date, View view) {
            setResult(Args.SELECTABLE_DATE_REQUEST, Common.createShowDateIntent(date));
            finish();
        }

        @Override
        public void onChangeMonth(int month, int year) {
            super.onChangeMonth(month, year);
            displayEntriesForVisibleMonths(DateUtil.getCalendarForYearAndMonth(year, month - 1), foodId);
        }
    });

    vgLegend.setVisibility(recommendedServings > 1 ? View.VISIBLE : View.GONE);

    final FragmentTransaction t = getSupportFragmentManager().beginTransaction();
    t.replace(R.id.calendar_fragment_container, caldroid);
    t.commit();
}
 
开发者ID:nutritionfactsorg,项目名称:daily-dozen-android,代码行数:26,代码来源:FoodHistoryActivity.java

示例2: setupView

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
public void setupView() {
   CaldroidFragment caldroidFragment = new CaldroidFragment();
Bundle args = new Bundle();
Calendar cal = Calendar.getInstance();
args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
args.putBoolean(CaldroidFragment.ENABLE_SWIPE, false);
args.putBoolean(CaldroidFragment.SIX_WEEKS_IN_CALENDAR, false);
args.putInt(CaldroidFragment.START_DAY_OF_WEEK, CaldroidFragment.MONDAY);
caldroidFragment.setArguments(args);
caldroidFragment.setCaldroidListener(listener);

FragmentTransaction t = getChildFragmentManager().beginTransaction();
t.replace(R.id.calendar1, caldroidFragment);
t.commit();
}
 
开发者ID:HelloKS,项目名称:ogdb-school-app,代码行数:17,代码来源:Calender.java

示例3: onCreate

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.studence_attendance_dialog);

    initialize();

    //initializing caldroid
    caldroidFragment = new CaldroidFragment();
    Bundle args = new Bundle();
    Calendar cal = Calendar.getInstance();
    args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
    args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
    caldroidFragment.setArguments(args);

    //binding caldroid to xml
    android.support.v4.app.FragmentTransaction t = getSupportFragmentManager().beginTransaction();
    t.add(R.id.caldroidCalendar, caldroidFragment);
    t.commit();

    //getting attendance from local database
    attendance = databaseHelper.getStudentAttendanceInfo(Integer.parseInt(SID), FSMID);

    getAbsentAndPresent();

    //getting absentDates and presentDates dates in above maps
    setColorForPresent();
    setColorForAbsent();

    present.setText(presentDates.size() + "");
    absent.setText(absentDates.size() + "");

    displayPercent();

    //setting background colors for dates and text
    caldroidFragment.setBackgroundDrawableForDates(backgroundForDateMap);
    caldroidFragment.setTextColorForDates(textForDateMap);
}
 
开发者ID:CoepPortal,项目名称:PortalApp,代码行数:39,代码来源:StudentAttendanceDialogActivity.java

示例4: onCreate

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_fragment_with_toolbar);
    ButterKnife.bind(this);
    CalendarActivityIntentBuilder.inject(getIntent(), this);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    userRecords = new UserRecords(this);
    DateTime today = DateTime.now();
    if (defDateTime == null) {
        defDateTime = today;
    }

    Bundle args = new Bundle();
    args.putInt(CaldroidFragment.MONTH, defDateTime.getMonthOfYear());
    args.putInt(CaldroidFragment.YEAR, defDateTime.getYear());

    fragment = new CaldroidFragment();
    fragment.setArguments(args);
    fragment.setMaxDate(today.toDate());
    fragment.setSelectedDate(defDateTime.toDate());
    fragment.setCaldroidListener(new CaldroidListener() {
        @Override
        public void onSelectDate(Date date, View view) {
            onDateSelected(date);
        }
    });

    getSupportFragmentManager().beginTransaction()
        .replace(R.id.content, fragment)
        .commit();

    loadPrayerRecords();
}
 
开发者ID:akhy,项目名称:MuslimTracker,代码行数:37,代码来源:CalendarActivity.java

示例5: showCaldroidFragment

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void showCaldroidFragment() {
    Locale appLocale = MmexApplication.getApp().getAppLocale();
    CaldroidFragment caldroidFragment = new CaldroidFragment();


    // Customization
    Bundle args = new Bundle();
    Calendar cal = Calendar.getInstance(appLocale);
    args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
    args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
    args.putInt(CaldroidFragment.START_DAY_OF_WEEK, dateTimeUtilsLazy.get().getFirstDayOfWeek());
    if (new UIHelper(getActivity()).isUsingDarkTheme()) {
        args.putInt(CaldroidFragment.THEME_RESOURCE, com.caldroid.R.style.CaldroidDefaultDark);
    }
    // disable switching month for now.
    args.putBoolean(CaldroidFragment.SHOW_NAVIGATION_ARROWS, Boolean.FALSE);
    args.putBoolean(CaldroidFragment.ENABLE_SWIPE, Boolean.FALSE);
    caldroidFragment.setArguments(args);

    // add different background for dates with events.
    showDatesWithEvents(caldroidFragment);

    // behaviour
    caldroidFragment.setCaldroidListener(getCalendarListener());

    android.support.v4.app.FragmentTransaction t = getActivity().getSupportFragmentManager()
            .beginTransaction();
    t.replace(R.id.fragmentMain, caldroidFragment);
    t.addToBackStack(null);
    t.commit();
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:32,代码来源:RecurringTransactionListFragment.java

示例6: showDatesWithEvents

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void showDatesWithEvents(CaldroidFragment caldroid) {
    ListAdapter adapter = getListAdapter();
    int count = adapter.getCount();
    ColorDrawable orange = new ColorDrawable(ContextCompat.getColor(getActivity(), R.color.holo_orange_dark));
    RecurringTransaction tx = RecurringTransaction.createInstance();

    for (int i = 0; i < count; i++) {
        Cursor cursor = (Cursor) adapter.getItem(i);
        tx.loadFromCursor(cursor);

        caldroid.setBackgroundDrawableForDate(orange, tx.getPaymentDate());
    }
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:14,代码来源:RecurringTransactionListFragment.java

示例7: initCaldroidDialog

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void initCaldroidDialog(){
    dialogCaldroidFragment = new CaldroidFragment();
    dialogCaldroidFragment.setCaldroidListener(listener);
    Bundle bundle = new Bundle();
    bundle.putBoolean(CaldroidFragment.SHOW_NAVIGATION_ARROWS,
            true);
    bundle.putString(CaldroidFragment.DIALOG_TITLE,
            "Select a date");
    dialogCaldroidFragment.setArguments(bundle);
}
 
开发者ID:iSCAU,项目名称:iSCAU-Android,代码行数:11,代码来源:CardParam.java

示例8: setUpCalendar

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void setUpCalendar(){

        caldroidFragment = new CaldroidFragment();
        setCalendarCurrentYearMonth();
        setCalendarFontAndListener();
        showCalendarInFragment();
    }
 
开发者ID:iSCAU,项目名称:iSCAU-Android,代码行数:8,代码来源:Calendar.java

示例9: setCalendarCurrentYearMonth

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
private void setCalendarCurrentYearMonth(){
    Bundle args      = new Bundle();
    args.putInt(CaldroidFragment.YEAR,  currentYear);
    args.putInt(CaldroidFragment.MONTH, currentMonth + 1);
    args.putBoolean(CaldroidFragment.SHOW_NAVIGATION_ARROWS,false);
    caldroidFragment.setArguments(args);
}
 
开发者ID:iSCAU,项目名称:iSCAU-Android,代码行数:8,代码来源:Calendar.java

示例10: onCreate

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	this.caldroidFragment = new CaldroidFragment();

	this.marcarReservasCalendario();

	if (savedInstanceState != null) {
		this.caldroidFragment.restoreStatesFromKey(savedInstanceState, "CALDROID_SAVED_STATE");
	} else {
		Bundle args = new Bundle();
		Calendar cal = Calendar.getInstance();
		args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
		args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
		this.caldroidFragment.setArguments(args);

		this.getSupportFragmentManager().beginTransaction().replace(R.id.calendario, this.caldroidFragment).commit();
	}

	this.caldroidFragment.setCaldroidListener(new AMCaldroidListener());

	Calendar calendar = Calendar.getInstance();
	calendar.set(Calendar.HOUR_OF_DAY, 0);
	calendar.set(Calendar.MINUTE, 0);
	calendar.set(Calendar.SECOND, 0);
	calendar.set(Calendar.MILLISECOND, 0);
	this.dataSelecionada = calendar.getTime();

	this.caldroidFragment.setBackgroundResourceForDate(R.color.areamanager_selecionada, this.dataSelecionada);
}
 
开发者ID:falvojr,项目名称:area-manager,代码行数:32,代码来源:CalendarioActivity.java

示例11: onCreate

import com.roomorama.caldroid.CaldroidFragment; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_block_slot);
    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setNavigationBarColor(getResources().getColor(R.color.navigationBarColor));
    }

    // setup Toolbar
    mToolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(mToolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    //getSupportActionBar().setDisplayShowHomeEnabled(true);
    mToolbar.setNavigationIcon(R.drawable.ic_back_arrow);
    mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });

    bProceedToPayment = (Button)findViewById(R.id.bProceedToPayment);
    bSelectSlot = (Button) findViewById(R.id.bSelectSlot);

    addToCartCount = 0;
    if(addToCartCount > 0){
        bProceedToPayment.setText(Html.fromHtml("Checkout ("+addToCartCount+")"));
    }

    name =  getIntent().getStringExtra("etName");
    phoneno =  getIntent().getStringExtra("etPhoneNumber");
    flag=false;

    if (savedInstanceState == null) {
        caldroidFragment = new CaldroidFragment();
        Bundle args = new Bundle();
        Calendar cal = Calendar.getInstance();
        args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
        args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
        args.putBoolean(CaldroidFragment.SQUARE_TEXT_VIEW_CELL, false);
        caldroidFragment.setArguments(args);
        currentDate = Calendar.getInstance().getTime();// get current date
        // adding one month to current date
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MONTH, 1);
        dateAfterMonth = calendar.getTime();
        caldroidFragment.setMinDate(currentDate); // disable dates prior to current date
        caldroidFragment.setMaxDate(dateAfterMonth);// disable dates after a month from current date
        getDaysBetweenDates(currentDate, dateAfterMonth, Trainer.currentTrainerObjectId);
        setupCaldroidListener(this);


        FragmentTransaction t = getSupportFragmentManager().beginTransaction();
        t.replace(R.id.flCalendar, caldroidFragment);
        t.commit();
    }

    dayOfTheWeek = simpleDayFormat.format(date);
    selectedDate = simpleDateStrFormat.format(date);
    userSelectedDate = date;
    alreadyBookedSlots(Trainer.currentTrainerObjectId, dayOfTheWeek, selectedDate, this);
    setupListener(this);

    if (getLoggedInUserId().equals("")) {
        // Start login activity
        Intent intent = new Intent(this, LoginActivity.class);
        startActivityForResult(intent, 20);
    }
}
 
开发者ID:fitness-buddy,项目名称:Fitness-Buddy-Group-Project,代码行数:70,代码来源:BlockSlotActivity.java


注:本文中的com.roomorama.caldroid.CaldroidFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。