From 00beb694be9fc0278e6d4336b30a546f4adeec04 Mon Sep 17 00:00:00 2001 From: Flavien Norindr Date: Tue, 13 Oct 2015 09:48:49 +0200 Subject: [PATCH] Added Licence stuff --- LICENCE | 2 +- .../chipview/sample/MainChipViewAdapter.java | 6 +++++- .../plumillonforge/android/chipview/Chip.java | 20 +++++++++++++++---- .../android/chipview/ChipView.java | 16 +++++++++++++++ .../android/chipview/ChipViewAdapter.java | 19 ++++++++++++++++-- .../android/chipview/OnChipClickListener.java | 16 +++++++++++++++ 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/LICENCE b/LICENCE index 7699b97..62ac6dd 100644 --- a/LICENCE +++ b/LICENCE @@ -175,7 +175,7 @@ END OF TERMS AND CONDITIONS - Copyright 2015 Flavien Norindr + Copyright 2015 Flavien Norindr (aka Plumillon Forge) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/app/src/main/java/com/plumillonforge/android/chipview/sample/MainChipViewAdapter.java b/app/src/main/java/com/plumillonforge/android/chipview/sample/MainChipViewAdapter.java index a34b04c..600d713 100644 --- a/app/src/main/java/com/plumillonforge/android/chipview/sample/MainChipViewAdapter.java +++ b/app/src/main/java/com/plumillonforge/android/chipview/sample/MainChipViewAdapter.java @@ -2,12 +2,13 @@ import android.content.Context; import android.view.View; +import android.widget.TextView; import com.plumillonforge.android.chipview.Chip; import com.plumillonforge.android.chipview.ChipViewAdapter; /** - * Created by Flavien on 09/10/15. + * Created by Plumillon Forge on 09/10/15. */ public class MainChipViewAdapter extends ChipViewAdapter { public MainChipViewAdapter(Context context) { @@ -66,6 +67,9 @@ public int getBackgroundRes(int position) { @Override public void onLayout(View view, int position) { + Tag tag = (Tag) getChip(position); + if (tag.getType() == 2) + ((TextView) view.findViewById(android.R.id.text1)).setTextColor(getColor(R.color.blue)); } } diff --git a/library/src/main/java/com/plumillonforge/android/chipview/Chip.java b/library/src/main/java/com/plumillonforge/android/chipview/Chip.java index 115e97c..d449d7a 100644 --- a/library/src/main/java/com/plumillonforge/android/chipview/Chip.java +++ b/library/src/main/java/com/plumillonforge/android/chipview/Chip.java @@ -1,8 +1,20 @@ -package com.plumillonforge.android.chipview; +/* + Copyright 2015 Flavien Norindr (aka Plumillon Forge) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 -import android.content.Context; -import android.os.Parcelable; -import android.view.View; + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +package com.plumillonforge.android.chipview; /** * Created by Plumillon Forge on 17/09/15. diff --git a/library/src/main/java/com/plumillonforge/android/chipview/ChipView.java b/library/src/main/java/com/plumillonforge/android/chipview/ChipView.java index 0df9213..62f91cd 100644 --- a/library/src/main/java/com/plumillonforge/android/chipview/ChipView.java +++ b/library/src/main/java/com/plumillonforge/android/chipview/ChipView.java @@ -1,3 +1,19 @@ +/* + Copyright 2015 Flavien Norindr (aka Plumillon Forge) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + package com.plumillonforge.android.chipview; import android.content.Context; diff --git a/library/src/main/java/com/plumillonforge/android/chipview/ChipViewAdapter.java b/library/src/main/java/com/plumillonforge/android/chipview/ChipViewAdapter.java index cd12913..04bfcfa 100644 --- a/library/src/main/java/com/plumillonforge/android/chipview/ChipViewAdapter.java +++ b/library/src/main/java/com/plumillonforge/android/chipview/ChipViewAdapter.java @@ -1,3 +1,19 @@ +/* + Copyright 2015 Flavien Norindr (aka Plumillon Forge) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + package com.plumillonforge.android.chipview; import android.content.Context; @@ -22,7 +38,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Observable; -import java.util.zip.Inflater; /** * Created by Plumillon Forge on 09/10/15. @@ -100,7 +115,7 @@ public View getView(ViewGroup parent, int position) { View view = null; Chip chip = getChip(position); - if(chip != null) { + if (chip != null) { int chipLayoutRes = (getLayoutRes(position) != 0 ? getLayoutRes(position) : getChipLayoutRes()); Drawable chipBackground = generateBackgroundSelector(position); diff --git a/library/src/main/java/com/plumillonforge/android/chipview/OnChipClickListener.java b/library/src/main/java/com/plumillonforge/android/chipview/OnChipClickListener.java index 657c432..9ccd42c 100644 --- a/library/src/main/java/com/plumillonforge/android/chipview/OnChipClickListener.java +++ b/library/src/main/java/com/plumillonforge/android/chipview/OnChipClickListener.java @@ -1,3 +1,19 @@ +/* + Copyright 2015 Flavien Norindr (aka Plumillon Forge) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + package com.plumillonforge.android.chipview; /**