aboutsummaryrefslogtreecommitdiff
path: root/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt')
-rw-r--r--core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt24
1 files changed, 20 insertions, 4 deletions
diff --git a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt
index 5db5eaa..ef95ed3 100644
--- a/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt
+++ b/core-ui/src/main/kotlin/ca/allanwang/kau/ui/views/MeasuredImageView.kt
@@ -1,14 +1,31 @@
+/*
+ * Copyright 2018 Allan Wang
+ *
+ * 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 ca.allanwang.kau.ui.views
import android.content.Context
-import android.support.v7.widget.AppCompatImageView
import android.util.AttributeSet
+import androidx.appcompat.widget.AppCompatImageView
/**
* Created by Allan Wang on 2017-07-14.
*/
class MeasuredImageView @JvmOverloads constructor(
- context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyleAttr: Int = 0
) : AppCompatImageView(context, attrs, defStyleAttr), MeasureSpecContract by MeasureSpecDelegate() {
init {
@@ -19,5 +36,4 @@ class MeasuredImageView @JvmOverloads constructor(
val result = onMeasure(this, widthMeasureSpec, heightMeasureSpec)
super.onMeasure(result.first, result.second)
}
-
-} \ No newline at end of file
+}