Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
It's time to move on!

Egemen ÖZOGUL AsynctaskCoffee

💪
It's time to move on!
View GitHub Profile
View part.java
frameLayout = findViewById(R.id.frameLayout)
videoLayout = VideoLayout(this)
videoLayout.setGravity(VideoLayout.VGravity.centerCrop)
videoLayout.setIsLoop(true)
videoLayout.setPathOrUrl("loginvideotype3.mp4") // could be any video url
frameLayout.addView(videoLayout)
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<egolabsapps.basicodemine.videolayout.VideoLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/videoLayout"
app:path_or_url="walking.mp4"
app:video_gravity="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
View build.gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.github.AsynctaskCoffee:VideoLayout:1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
View build.gradle
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
View login_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/videoLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:focusable="true"
android:focusableInTouchMode="true"
tools:context=".MainActivity">
View activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<egolabsapps.basicodemine.offlinemap.Views.OfflineMapView
android:id="@+id/map"
android:layout_width="match_parent"
View MainAcitivity.java
public class MainActivity extends AppCompatActivity implements MapListener{
OfflineMapView offlineMapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
offlineMapView = findViewById(R.id.map);
offlineMapView.init(this, this);
View build.gradle
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.github.AsynctaskCoffee:AndroidOfflineMapLibrary:v1'
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
implementation 'org.osmdroid:osmdroid-android:6.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'