Skip to content

Commit

Permalink
Merged Code
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeNoob committed May 1, 2019
1 parent 7799a96 commit 4b4ffe4
Show file tree
Hide file tree
Showing 102 changed files with 146 additions and 899 deletions.
6 changes: 0 additions & 6 deletions NudgeApp/.idea/vcs.xml

This file was deleted.

35 changes: 0 additions & 35 deletions NudgeApp/app/src/main/AndroidManifest.xml

This file was deleted.

13 changes: 0 additions & 13 deletions NudgeApp/app/src/main/java/com/example/nudgeapp/MainActivity.java

This file was deleted.

39 changes: 0 additions & 39 deletions NudgeApp/app/src/main/java/com/example/nudgeapp/login.java

This file was deleted.

18 changes: 0 additions & 18 deletions NudgeApp/app/src/main/res/layout/activity_main.xml

This file was deleted.

3 changes: 0 additions & 3 deletions NudgeApp/app/src/main/res/values/strings.xml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.nudgeapp"
applicationId "com.example.nudgerewriten"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.nudgeapp;
package com.example.nudgerewriten;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand All @@ -21,6 +21,6 @@ public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.example.nudgeapp", appContext.getPackageName());
assertEquals("com.example.nudgerewriten", appContext.getPackageName());
}
}
23 changes: 23 additions & 0 deletions NudgeRewriten/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.example.nudgerewriten">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="Nudge"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".SplashScreenActivity" android:theme="@style/AppTheme1">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".LoginActivity" android:theme="@style/AppTheme"/>
<activity android:name=".MainActivity">
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.os.Bundle;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.example.nudgerewriten;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class LoginActivity extends AppCompatActivity {

public static final String SHARED_PREFS = "sharedPrefs";
public static final String TEXT = "text";
private EditText licencecode;
private Button savebtn;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final SharedPreferences msharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);

if (msharedPreferences.contains(SHARED_PREFS))
{
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
}
else
{
setContentView(R.layout.activity_login);
licencecode = (EditText) findViewById(R.id.licenceCode);
savebtn = (Button) findViewById(R.id.submitButton);
savebtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

savedata();
}
public void savedata() //To save Data in SharePreferences
{
SharedPreferences.Editor editor = msharedPreferences.edit();
editor.putString(TEXT, licencecode.getText().toString());
editor.apply();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
}
});


}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
package com.example.bottom_navigation;
package com.example.nudgerewriten;

import android.support.annotation.NonNull;
import android.support.design.internal.BottomNavigationMenuView;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.support.design.widget.BottomNavigationView;

public class MainActivity extends AppCompatActivity {

private View configurationActivity;

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

BottomNavigationView botNav = findViewById(R.id.bottom_navigation);
botNav.setOnNavigationItemSelectedListener(navlistener);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package com.example.nudgeapp;
package com.example.nudgerewriten;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;

public class HomeActivity extends AppCompatActivity {
public class SplashScreenActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
setContentView(R.layout.activity_splashscreen);
Handler handler=new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(HomeActivity.this,login.class);
Intent intent=new Intent(SplashScreenActivity.this, LoginActivity.class);
startActivity(intent);
finish();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:id="@+id/loginForm">

<TextView
android:id="@+id/Enter"
android:id="@+id/intro"
android:layout_width="230dp"
android:layout_height="29dp"
android:fontFamily="@font/roboto_medium"
Expand All @@ -20,13 +20,13 @@
android:textSize="22dp"
/>
<EditText
android:id="@+id/licencecode"
android:id="@+id/licenceCode"
android:layout_width="260dp"
android:layout_height="46dp"
android:ems="10"
android:inputType="textPersonName"
android:background="@drawable/edit_round"
android:layout_below="@+id/Enter"
android:layout_below="@+id/intro"
android:layout_centerInParent="true"
/>

Expand All @@ -35,7 +35,7 @@
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="46dp"
android:layout_below="@+id/licencecode"
android:layout_below="@+id/licenceCode"
android:layout_centerInParent="true"
android:layout_marginTop="24dp"
android:fontFamily="@font/roboto_medium"
Expand All @@ -44,12 +44,13 @@
android:textSize="14dp" />

<Button
android:id="@+id/submit"
android:id="@+id/submitButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="@drawable/edit_round"
android:text="Log In" />


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:background="#3CCC00"
android:backgroundTint="#7ED957"
tools:context=".HomeActivity">
tools:context=".SplashScreenActivity">


<ImageView
Expand Down
Loading

0 comments on commit 4b4ffe4

Please sign in to comment.