Skip to content

Commit

Permalink
RegisterFragment and fragment_register layout created.
Browse files Browse the repository at this point in the history
DataBinding added.
.gitignore updated.
Loading library added. ( gradle )
EdittextValidation library added. ( gradle )
  • Loading branch information
ercanpinar committed Feb 3, 2017
1 parent 142aaa6 commit 3b0fe49
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 17 deletions.
8 changes: 3 additions & 5 deletions .gitignore
Expand Up @@ -47,14 +47,12 @@ captures/
.externalNativeBuild

#.gitignore
#.idea/

.idea/
#app/
#build.gradle
#gradle.properties
#gradle/
#gradlew
#gradlew.bat
gradlew.bat
#settings.gradle

#streethawkexample.iml
streethawkexample.iml
5 changes: 5 additions & 0 deletions app/build.gradle
Expand Up @@ -17,13 +17,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true;
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.wang.avi:library:2.1.3'
compile('com.andreabaccega:android-form-edittext:1.3.+')
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
}
Expand Up @@ -7,7 +7,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* Instrumentation test, which will execute on an Android device.
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.streethawk.example" >
package="com.streethawk.example">

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

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/streethawk/example/MainActivity.java
@@ -1,7 +1,7 @@
package com.streethawk.example;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

Expand Down
30 changes: 30 additions & 0 deletions app/src/main/java/com/streethawk/example/RegisterFragment.java
@@ -0,0 +1,30 @@
package com.streethawk.example;

import android.app.Fragment;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.streethawk.example.databinding.FragmentRegisterBinding;

/**
* Created by ercanpinar on 03/02/2017.
*/

public class RegisterFragment extends Fragment {

private FragmentRegisterBinding fragmentRegisterBinding;


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
fragmentRegisterBinding = DataBindingUtil.inflate(
inflater, R.layout.fragment_register, container, false);


return fragmentRegisterBinding.getRoot();
}
}
13 changes: 7 additions & 6 deletions app/src/main/res/layout/activity_main.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
Expand All @@ -11,8 +10,10 @@
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.streethawk.example.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
<fragment
android:name="com.streethawk.example.RegisterFragment"
android:id="@+id/register_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</RelativeLayout>
55 changes: 55 additions & 0 deletions app/src/main/res/layout/fragment_register.xml
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:whatever="http://schemas.android.com/apk/res-auto">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="10dp">

<TextView
android:text="New Person"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textStyle="bold"
android:gravity="center"
android:textSize="18sp"
android:layout_marginBottom="20dp" />

<com.andreabaccega.widget.FormEditText
whatever:testType="alpha"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editTextName"
android:hint="Name"
android:background="@color/gray_edittext_background"
android:layout_marginBottom="20dp" />


<com.andreabaccega.widget.FormEditText
whatever:testType="alpha"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/editTextInformation"
android:hint="Information"
android:background="@color/gray_edittext_background"
android:layout_marginBottom="20dp" />

<Button
android:text="Send"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/button"
android:layout_margin="20dp" />

<Button
android:text="All Records"
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/button2"
android:layout_margin="20dp" />
</LinearLayout>
</layout>
3 changes: 3 additions & 0 deletions app/src/main/res/values/colors.xml
Expand Up @@ -3,4 +3,7 @@
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="black">#000000</color>
<color name="white">#FFFFFF</color>
<color name="gray_edittext_background">#F1F1F1</color>
</resources>
Expand Up @@ -2,7 +2,7 @@

import org.junit.Test;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

/**
* Example local unit test, which will execute on the development machine (host).
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -15,6 +15,7 @@ buildscript {
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}

Expand Down

0 comments on commit 3b0fe49

Please sign in to comment.