Skip to content

Commit 727614a

Browse files
committed
Update Widgets
1 parent b87b10d commit 727614a

File tree

5 files changed

+40
-2
lines changed

5 files changed

+40
-2
lines changed

.idea/vcs.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/res/layout/activity_main.xml

+8
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@
133133
app:endColor="@color/colorPrimaryDark"
134134
app:startColor="@color/colorAccent" />
135135

136+
<com.dvinfosys.widgets.TextView.MediumTextView
137+
android:layout_width="wrap_content"
138+
android:layout_height="wrap_content"
139+
android:layout_gravity="center"
140+
android:padding="8dp"
141+
android:text="MediumTextView" />
142+
143+
136144
<com.dvinfosys.widgets.VideoPlayer.VPVideoPlayerStandard
137145
android:id="@+id/vp_videoplayer"
138146
android:layout_width="match_parent"

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77

88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.4.0'
10+
classpath 'com.android.tools.build:gradle:3.4.1'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.dvinfosys.widgets.TextView;
2+
3+
import android.content.Context;
4+
import android.graphics.Typeface;
5+
import android.util.AttributeSet;
6+
import android.widget.TextView;
7+
8+
import com.dvinfosys.widgets.Utils.TextFontCache;
9+
10+
public class MediumTextView extends TextView {
11+
public MediumTextView(Context context) {
12+
super(context);
13+
applyCustomFont(context);
14+
}
15+
16+
public MediumTextView(Context context, AttributeSet attrs) {
17+
super(context, attrs);
18+
applyCustomFont(context);
19+
}
20+
21+
public MediumTextView(Context context, AttributeSet attrs, int defStyleAttr) {
22+
super(context, attrs, defStyleAttr);
23+
applyCustomFont(context);
24+
}
25+
26+
private void applyCustomFont(Context context) {
27+
Typeface customFont = TextFontCache.getTypeface("Poppins_Medium.ttf", context);
28+
setTypeface(customFont);
29+
}
30+
}

0 commit comments

Comments
 (0)