Skip to content

Commit

Permalink
fixed attrs name & jitpack setting
Browse files Browse the repository at this point in the history
  • Loading branch information
tlaabs committed Jan 26, 2019
1 parent 574dff3 commit 1a53cf6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions timetableview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 1a53cf6

Please sign in to comment.