Skip to content

Commit

Permalink
App added
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetumit committed Feb 21, 2022
1 parent 2b240c1 commit fe4cd12
Show file tree
Hide file tree
Showing 59 changed files with 1,264 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
30 changes: 30 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id 'com.android.application'
}

android {
compileSdkVersion 29

defaultConfig {
applicationId "com.dymos.vitabrowser"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {

implementation 'androidx.leanback:leanback:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
38 changes: 38 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dymos.vitabrowser">

<uses-feature
android:name="android.software.leanback"
android:required="false" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:allowBackup="true"
android:banner="@mipmap/ic_banner_vita"
android:icon="@mipmap/ic_banner_vita"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_vita"
android:supportsRtl="true"
android:theme="@style/Theme.VitaBrowser">
<activity
android:launchMode="singleTop"
android:name=".MainActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>

</activity>
</application>

</manifest>
28 changes: 28 additions & 0 deletions app/src/main/java/com/dymos/vitabrowser/Browser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.dymos.vitabrowser;

import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.SearchView;

public class Browser extends WebViewClient {
EditText searchBar;
WebView webView;
public Browser(EditText searchBar,WebView webView) {
this.searchBar = searchBar;
this.webView = webView;
}

@Override
public boolean shouldOverrideUrlLoading(WebView view, String s) {
view.loadUrl(s);
return true;
}

@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
searchBar.setHint(webView.getUrl());

}
}
Loading

0 comments on commit fe4cd12

Please sign in to comment.