diff --git a/app/src/main/java/com/simplemobiletools/calendar/activities/DayActivity.java b/app/src/main/java/com/simplemobiletools/calendar/activities/DayActivity.java index 31d0e637f..5a63ab5d2 100644 --- a/app/src/main/java/com/simplemobiletools/calendar/activities/DayActivity.java +++ b/app/src/main/java/com/simplemobiletools/calendar/activities/DayActivity.java @@ -1,15 +1,9 @@ package com.simplemobiletools.calendar.activities; -import android.content.DialogInterface; import android.content.Intent; -import android.content.res.Resources; import android.graphics.Color; -import android.graphics.PorterDuff; import android.os.Bundle; -import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; -import android.support.v7.app.AlertDialog; -import android.util.SparseBooleanArray; import android.view.ActionMode; import android.view.Menu; import android.view.MenuInflater; @@ -17,37 +11,27 @@ import android.view.MenuItem; import android.view.View; import android.widget.AbsListView; import android.widget.AdapterView; -import android.widget.DatePicker; -import android.widget.ImageView; -import android.widget.ListView; -import android.widget.RelativeLayout; -import android.widget.TextView; import com.simplemobiletools.calendar.Constants; import com.simplemobiletools.calendar.DBHelper; import com.simplemobiletools.calendar.Formatter; import com.simplemobiletools.calendar.R; import com.simplemobiletools.calendar.Utils; -import com.simplemobiletools.calendar.adapters.EventsAdapter; import com.simplemobiletools.calendar.models.Event; -import org.joda.time.DateTime; - import java.util.ArrayList; import java.util.List; import butterknife.BindDimen; -import butterknife.BindView; import butterknife.ButterKnife; -import butterknife.OnClick; public class DayActivity extends SimpleActivity implements DBHelper.DBOperationsListener, AdapterView.OnItemClickListener, AbsListView.MultiChoiceModeListener { - @BindView(R.id.month_value) TextView mDateTV; + /*@BindView(R.id.month_value) TextView mDateTV; @BindView(R.id.day_events) ListView mEventsList; @BindView(R.id.day_coordinator) CoordinatorLayout mCoordinatorLayout; @BindView(R.id.top_left_arrow) ImageView mLeftArrow; - @BindView(R.id.top_right_arrow) ImageView mRightArrow; + @BindView(R.id.top_right_arrow) ImageView mRightArrow;*/ @BindDimen(R.dimen.activity_margin) int mActivityMargin; @@ -75,19 +59,19 @@ public class DayActivity extends SimpleActivity return; final String date = Formatter.getEventDate(getApplicationContext(), mDayCode); - mDateTV.setText(date); + //mDateTV.setText(date); mToBeDeleted = new ArrayList<>(); final int baseColor = mConfig.getIsDarkTheme() ? Color.WHITE : Color.BLACK; final int textColor = Utils.adjustAlpha(baseColor, Constants.HIGH_ALPHA); - mLeftArrow.getDrawable().mutate().setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); + /*mLeftArrow.getDrawable().mutate().setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); mRightArrow.getDrawable().mutate().setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) mLeftArrow.getLayoutParams(); params.setMargins(mActivityMargin, params.topMargin, params.rightMargin, params.bottomMargin); params = (RelativeLayout.LayoutParams) mRightArrow.getLayoutParams(); - params.setMargins(params.leftMargin, params.topMargin, mActivityMargin, params.bottomMargin); + params.setMargins(params.leftMargin, params.topMargin, mActivityMargin, params.bottomMargin);*/ } @Override @@ -102,7 +86,7 @@ public class DayActivity extends SimpleActivity checkDeleteEvents(); } - @OnClick(R.id.day_fab) + /*@OnClick(R.id.day_fab) public void fabClicked(View view) { final Intent intent = new Intent(getApplicationContext(), EventActivity.class); intent.putExtra(Constants.DAY_CODE, mDayCode); @@ -147,7 +131,7 @@ public class DayActivity extends SimpleActivity }); alertDialog.show(); - } + }*/ private void switchToDay(String dayCode) { final Intent intent = new Intent(getApplicationContext(), DayActivity.class); @@ -171,11 +155,11 @@ public class DayActivity extends SimpleActivity private void updateEvents(List events) { mEvents = new ArrayList<>(events); - final List eventsToShow = getEventsToShow(events); + /*final List eventsToShow = getEventsToShow(events); final EventsAdapter adapter = new EventsAdapter(this, eventsToShow); mEventsList.setAdapter(adapter); mEventsList.setOnItemClickListener(this); - mEventsList.setMultiChoiceModeListener(this); + mEventsList.setMultiChoiceModeListener(this);*/ } private List getEventsToShow(List events) { @@ -298,7 +282,7 @@ public class DayActivity extends SimpleActivity } private void prepareDeleteEvents() { - final SparseBooleanArray checked = mEventsList.getCheckedItemPositions(); + /*final SparseBooleanArray checked = mEventsList.getCheckedItemPositions(); for (int i = 0; i < mEvents.size(); i++) { if (checked.get(i)) { final Event event = mEvents.get(i); @@ -306,17 +290,17 @@ public class DayActivity extends SimpleActivity } } - notifyEventDeletion(mToBeDeleted.size()); + notifyEventDeletion(mToBeDeleted.size());*/ } private void notifyEventDeletion(int cnt) { - final Resources res = getResources(); + /*final Resources res = getResources(); final String msg = res.getQuantityString(R.plurals.events_deleted, cnt, cnt); mSnackbar = Snackbar.make(mCoordinatorLayout, msg, Snackbar.LENGTH_INDEFINITE); mSnackbar.setAction(res.getString(R.string.undo), undoDeletion); mSnackbar.setActionTextColor(Color.WHITE); mSnackbar.show(); - updateEvents(mEvents); + updateEvents(mEvents);*/ } @Override diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt new file mode 100644 index 000000000..8fc7ab4c2 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/DayFragment.kt @@ -0,0 +1,16 @@ +package com.simplemobiletools.calendar.fragments + +import android.os.Bundle +import android.support.v4.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.simplemobiletools.calendar.R + +class DayFragment : Fragment() { + override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? { + val view = inflater!!.inflate(R.layout.day_fragment, container, false) + + return view + } +} diff --git a/app/src/main/res/layout/activity_day.xml b/app/src/main/res/layout/activity_day.xml index b49418b27..d54d81073 100644 --- a/app/src/main/res/layout/activity_day.xml +++ b/app/src/main/res/layout/activity_day.xml @@ -7,22 +7,10 @@ android:layout_height="match_parent" android:layout_marginTop="@dimen/activity_margin"> - - - - - - + android:layout_height="match_parent"/> + + + + + + +