Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vlevieux committed Oct 29, 2018
0 parents commit 9a98d4b
Show file tree
Hide file tree
Showing 47 changed files with 1,187 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.iml
.gradle
/local.properties
/.idea/caches/build_file_checksums.ser
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
.DS_Store
/build
/captures
.externalNativeBuild
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
40 changes: 40 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.vlevieux.drumtab"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:preference-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'
55 changes: 55 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"project_info": {
"project_number": "965642778400",
"firebase_url": "https://drumtab-f848e.firebaseio.com",
"project_id": "drumtab-f848e",
"storage_bucket": "drumtab-f848e.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:965642778400:android:e2770b5a55a7ed44",
"android_client_info": {
"package_name": "com.vlevieux.drumtab"
}
},
"oauth_client": [
{
"client_id": "965642778400-9ksoiqrjo50of64ec548gtflro26j32b.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.vlevieux.drumtab",
"certificate_hash": "dca9b87b8f69c50acb71a127d46faeb026348bca"
}
},
{
"client_id": "965642778400-q5fslu6qjuvv52dfrharfdvr5t2ld69i.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyCc7AKAj_rwGawju-UVKdIgoJN9SMpxA-c"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "965642778400-q5fslu6qjuvv52dfrharfdvr5t2ld69i.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.vlevieux.drumtab;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.vlevieux.drumtab", appContext.getPackageName());
}
}
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vlevieux.drumtab">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SettingActivity" />
<activity android:name=".TabActivity"></activity>
</application>

</manifest>
89 changes: 89 additions & 0 deletions app/src/main/java/com/vlevieux/drumtab/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package com.vlevieux.drumtab;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import java.util.Arrays;
import java.util.List;

public class MainActivity extends AppCompatActivity {

protected ListView tabList;

public class ListAdapter extends ArrayAdapter<Tab> {

int resourceLayout;
Context context;
ListAdapter(Context context, int resource, List<Tab> tabs) {
super(context, resource, tabs);
this.resourceLayout = resource;
this.context = context;
}

@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi;
vi = LayoutInflater.from(context);
v = vi.inflate(resourceLayout, null);
}
Tab p = getItem(position);
TextView name = v.findViewById(R.id.main_tv_name);
TextView info = v.findViewById(R.id.main_tv_more_info);
name.setText("Sum 41");
info.setText("BPM 150");
return v;
}
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Tab();

Intent intent = new Intent(this, TabActivity.class);
startActivity(intent);

generateToolBar();
generateTabListView();
}

protected void generateToolBar() {
Toolbar toolBar = findViewById(R.id.toolbar_main);
setSupportActionBar(toolBar);
if (getSupportActionBar() != null) {getSupportActionBar().setTitle("DrumTab");}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu);
return super.onCreateOptionsMenu(menu);
}

protected void generateTabListView(){
this.tabList = findViewById(R.id.main_lv_tabs);
ListAdapter customAdapter = new ListAdapter(this, R.layout.row, Arrays.asList(new Tab(), new Tab(),new Tab()));
tabList.setAdapter(customAdapter);
}

public void startSettingActivity(MenuItem item) {
Intent intent = new Intent(this, SettingActivity.class);
startActivity(intent);
}
}
Loading

0 comments on commit 9a98d4b

Please sign in to comment.