From 1a53cf66738d94bfc1271623161e9e4c966c6cea Mon Sep 17 00:00:00 2001 From: tlaabs Date: Sun, 27 Jan 2019 02:34:24 +0900 Subject: [PATCH] fixed attrs name & jitpack setting --- build.gradle | 2 +- timetableview/build.gradle | 2 ++ .../tlaabs/timetableview/TimetableView.java | 18 +++++++++--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 8d3ef8e..33e26a2 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' - + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/timetableview/build.gradle b/timetableview/build.gradle index ba2dadc..2b6c32b 100644 --- a/timetableview/build.gradle +++ b/timetableview/build.gradle @@ -32,3 +32,5 @@ dependencies { implementation 'com.google.code.gson:gson:2.8.5' } +apply plugin: 'com.github.dcendents.android-maven' +group='com.github.tlaabs' \ No newline at end of file diff --git a/timetableview/src/main/java/com/github/tlaabs/timetableview/TimetableView.java b/timetableview/src/main/java/com/github/tlaabs/timetableview/TimetableView.java index 29658a9..10828c9 100644 --- a/timetableview/src/main/java/com/github/tlaabs/timetableview/TimetableView.java +++ b/timetableview/src/main/java/com/github/tlaabs/timetableview/TimetableView.java @@ -73,17 +73,17 @@ public TimetableView(Context context, AttributeSet attrs, int defStyleAttr) { } private void getAttrs(AttributeSet attrs) { - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.tableAttrs); - rowCount = a.getInt(R.styleable.tableAttrs_row_count, DEFAULT_ROW_COUNT) - 1; - columnCount = a.getInt(R.styleable.tableAttrs_column_count, DEFAULT_COLUMN_COUNT); - cellHeight = a.getDimensionPixelSize(R.styleable.tableAttrs_cell_height, dp2Px(DEFAULT_CELL_HEIGHT_DP)); - sideCellWidth = a.getDimensionPixelSize(R.styleable.tableAttrs_side_cell_width, dp2Px(DEFAULT_SIDE_CELL_WIDTH_DP)); - int titlesId = a.getResourceId(R.styleable.tableAttrs_header_title, R.array.default_header_title); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TimetableView); + rowCount = a.getInt(R.styleable.TimetableView_row_count, DEFAULT_ROW_COUNT) - 1; + columnCount = a.getInt(R.styleable.TimetableView_column_count, DEFAULT_COLUMN_COUNT); + cellHeight = a.getDimensionPixelSize(R.styleable.TimetableView_cell_height, dp2Px(DEFAULT_CELL_HEIGHT_DP)); + sideCellWidth = a.getDimensionPixelSize(R.styleable.TimetableView_side_cell_width, dp2Px(DEFAULT_SIDE_CELL_WIDTH_DP)); + int titlesId = a.getResourceId(R.styleable.TimetableView_header_title, R.array.default_header_title); headerTitle = a.getResources().getStringArray(titlesId); - int colorsId = a.getResourceId(R.styleable.tableAttrs_sticker_colors, R.array.default_sticker_color); + int colorsId = a.getResourceId(R.styleable.TimetableView_sticker_colors, R.array.default_sticker_color); stickerColors = a.getResources().getStringArray(colorsId); - startTime = a.getInt(R.styleable.tableAttrs_start_time, DEFAULT_START_TIME); - headerHighlightColor = a.getColor(R.styleable.tableAttrs_header_highlight_color, getResources().getColor(R.color.default_header_highlight_color)); + startTime = a.getInt(R.styleable.TimetableView_start_time, DEFAULT_START_TIME); + headerHighlightColor = a.getColor(R.styleable.TimetableView_header_highlight_color, getResources().getColor(R.color.default_header_highlight_color)); a.recycle(); }