Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar nav buttons under material design theme (non androidx) #484

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:3.4.2'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
Expand Down
13 changes: 7 additions & 6 deletions caldroid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 8
targetSdkVersion 22
minSdkVersion 14
targetSdkVersion 28
}
}

dependencies {
compile 'com.android.support:support-v4:22.2.0'
compile 'com.darwinsys:hirondelle-date4j:1.5.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.darwinsys:hirondelle-date4j:1.5.1'
}

apply from: 'https://raw.githubusercontent.com/shamanland/gradle-mvn-push/cc18d56549cdea03f744b6fff27911569394073e/gradle-mvn-push.gradle'
7 changes: 3 additions & 4 deletions caldroid/src/main/java/com/roomorama/caldroid/CellView.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;
import com.caldroid.R;

import java.util.ArrayList;

/**
* Created by crocodile2u on 3/30/15.
*/
public class CellView extends TextView {
public class CellView extends android.support.v7.widget.AppCompatTextView {

public static final int STATE_TODAY = R.attr.state_date_today;
public static final int STATE_SELECTED = R.attr.state_date_selected;
public static final int STATE_DISABLED = R.attr.state_date_disabled;
public static final int STATE_PREV_NEXT_MONTH = R.attr.state_date_prev_next_month;

private ArrayList<Integer> customStates = new ArrayList<Integer>();
private ArrayList<Integer> customStates = new ArrayList<>();

public CellView(Context context) {
super(context);
Expand All @@ -34,7 +33,7 @@ public CellView(Context context, AttributeSet attrs) {
}

private void init() {
if (null == customStates) customStates = new ArrayList<Integer>();
if (null == customStates) customStates = new ArrayList<>();
}

public void resetCustomStates() {
Expand Down
4 changes: 2 additions & 2 deletions caldroid/src/main/res/layout/calendar_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
<android.support.design.button.MaterialButton
android:id="@+id/calendar_left_arrow"
style="?styleCaldroidLeftArrow" />

<TextView
android:id="@+id/calendar_month_year_textview"
style="?styleCaldroidMonthName"/>

<Button
<android.support.design.button.MaterialButton
android:id="@+id/calendar_right_arrow"
style="?styleCaldroidRightArrow" />
</LinearLayout>
Expand Down
11 changes: 0 additions & 11 deletions caldroid/src/main/res/values-v11/styles.xml

This file was deleted.

12 changes: 0 additions & 12 deletions caldroid/src/main/res/values-v14/styles.xml

This file was deleted.

12 changes: 9 additions & 3 deletions caldroid/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="CaldroidDefault">
<item name="styleCaldroidViewLayout">@style/CaldroidDefaultCalendarViewLayout</item>
<item name="styleCaldroidLeftArrow">@style/CaldroidDefaultLeftButton</item>
Expand All @@ -17,19 +18,24 @@
<item name="android:layout_height">wrap_content</item>
</style>

<style name="CaldroidDefaultArrowButton">
<style name="CaldroidDefaultArrowButton" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:layout_width">44dp</item>
<item name="android:layout_height">44dp</item>
<item name="android:layout_margin">2dp</item>
<item name="iconPadding">0dp</item>
<item name="iconTint">#18567D</item>
<item name="iconGravity">textStart</item>
<item name="backgroundTint">#00000000</item>
</style>

<style name="CaldroidDefaultLeftButton" parent="CaldroidDefaultArrowButton">
<item name="android:layout_alignParentLeft">true</item>
<item name="android:background">@drawable/left_arrow</item>
<item name="icon">@drawable/calendar_prev_arrow</item>
</style>

<style name="CaldroidDefaultRightButton" parent="CaldroidDefaultArrowButton">
<item name="android:layout_alignParentRight">true</item>
<item name="android:background">@drawable/right_arrow</item>
<item name="icon">@drawable/calendar_next_arrow</item>
</style>

<style name="CaldroidDefaultMonthName">
Expand Down
16 changes: 9 additions & 7 deletions caldroidSampleActivity/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
applicationId "com.caldroidsample"
minSdkVersion 8
targetSdkVersion 22
minSdkVersion 14
targetSdkVersion 28
}

buildTypes {
Expand All @@ -19,7 +19,9 @@ android {
}

dependencies {
compile project(':caldroid')
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
implementation project(':caldroid')
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.darwinsys:hirondelle-date4j:1.5.1'
}
2 changes: 1 addition & 1 deletion caldroidSampleActivity/src/main/res/values-v11/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<style name="AppBaseTheme" parent="Theme.MaterialComponents.Light">
<!-- API 11 theme customizations can go here. -->
</style>

Expand Down
2 changes: 1 addition & 1 deletion caldroidSampleActivity/src/main/res/values-v14/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<style name="AppBaseTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>

Expand Down
4 changes: 2 additions & 2 deletions caldroidSampleActivity/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat">
<style name="AppBaseTheme" parent="Theme.MaterialComponents.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
Expand All @@ -13,7 +13,7 @@
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<style name="AppTheme" parent="Theme.MaterialComponents.Light">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Feb 05 14:08:01 CST 2015
#Thu Aug 22 21:31:00 EEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip