erro ao iniciar
This commit is contained in:
37
app/src/main/java/com/fluxup/app/AuthManager.java
Normal file
37
app/src/main/java/com/fluxup/app/AuthManager.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.fluxup.app;
|
||||
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
|
||||
public class AuthManager {
|
||||
private static AuthManager instance;
|
||||
|
||||
private AuthManager() {
|
||||
// private constructor
|
||||
}
|
||||
|
||||
public static synchronized AuthManager getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new AuthManager();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public FirebaseUser getCurrentUser() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void loginUtilizador(String email, String password, AuthCallback callback) {
|
||||
// Mock implementation
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
public void registrarUtilizador(String email, String password, AuthCallback callback) {
|
||||
// Mock implementation
|
||||
callback.onSuccess();
|
||||
}
|
||||
|
||||
public interface AuthCallback {
|
||||
void onSuccess();
|
||||
void onFailure(Exception e);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.fluxup.app;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
@@ -47,6 +47,8 @@ public class MainActivity extends AppCompatActivity {
|
||||
selectedFragment = new InicioFragment();
|
||||
} else if (itemId == R.id.nav_profile) {
|
||||
selectedFragment = new ProfileFragment();
|
||||
} else if (itemId == R.id.nav_search) {
|
||||
selectedFragment = new SearchFragment();
|
||||
}
|
||||
|
||||
if (selectedFragment != null) {
|
||||
|
||||
58
app/src/main/java/com/fluxup/app/SearchFragment.java
Normal file
58
app/src/main/java/com/fluxup/app/SearchFragment.java
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
package com.fluxup.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class SearchFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private EditText searchBar;
|
||||
private ArrayAdapter<String> adapter;
|
||||
private ArrayList<String> allItems;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_search, container, false);
|
||||
|
||||
recyclerView = view.findViewById(R.id.recycler_view);
|
||||
searchBar = view.findViewById(R.id.search_bar);
|
||||
|
||||
allItems = new ArrayList<>(Arrays.asList("Item 1", "Item 2", "Item 3", "Another Item", "More Items"));
|
||||
|
||||
adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, allItems);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
searchBar.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
adapter.getFilter().filter(s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
||||
12
app/src/main/java/com/fluxup/app/StreakActivity.java
Normal file
12
app/src/main/java/com/fluxup/app/StreakActivity.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package com.fluxup.app;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class StreakActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_streak);
|
||||
}
|
||||
}
|
||||
5
app/src/main/res/drawable/button_primary.xml
Normal file
5
app/src/main/res/drawable/button_primary.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#CCCCCC" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/card_duo.xml
Normal file
6
app/src/main/res/drawable/card_duo.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#FFFFFF" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/ic_flame.xml
Normal file
9
app/src/main/res/drawable/ic_flame.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z" />
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_nav_search.xml
Normal file
10
app/src/main/res/drawable/ic_nav_search.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,5 1.49,-1.49L15.5,14zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/progress_bar_duo.xml
Normal file
5
app/src/main/res/drawable/progress_bar_duo.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#CCCCCC" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/timer_circle_bg.xml
Normal file
5
app/src/main/res/drawable/timer_circle_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="#CCCCCC" />
|
||||
</shape>
|
||||
12
app/src/main/res/layout/activity_streak.xml
Normal file
12
app/src/main/res/layout/activity_streak.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Streak Activity" />
|
||||
|
||||
</LinearLayout>
|
||||
18
app/src/main/res/layout/fragment_search.xml
Normal file
18
app/src/main/res/layout/fragment_search.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/search_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Search..." />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/search_bar" />
|
||||
|
||||
</RelativeLayout>
|
||||
41
app/src/main/res/layout/item_day_node.xml
Normal file
41
app/src/main/res/layout/item_day_node.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dayOfMonth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dayOfWeek"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Mon"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/topConnector"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
<View
|
||||
android:id="@+id/node"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bottomConnector"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="16dp"
|
||||
android:background="@android:color/darker_gray" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -8,4 +8,8 @@
|
||||
android:id="@+id/nav_profile"
|
||||
android:icon="@drawable/ic_nav_profile"
|
||||
android:title="Perfil" />
|
||||
<item
|
||||
android:id="@+id/nav_search"
|
||||
android:icon="@drawable/ic_nav_search"
|
||||
android:title="Search" />
|
||||
</menu>
|
||||
|
||||
7
app/src/main/res/values/ids.xml
Normal file
7
app/src/main/res/values/ids.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="nodeCircle" type="id">circle</item>
|
||||
<item name="nodeDayInitial" type="id">dayInitial</item>
|
||||
<item name="nodeDayLabel" type="id">nodeDayLabel</item>
|
||||
<item name="nodeProgress" type="id">nodeProgress</item>
|
||||
</resources>
|
||||
@@ -2,18 +2,18 @@
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.Fluxup" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primary_purple</item>
|
||||
<item name="colorPrimaryVariant">@color/primary_purple_dark</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<item name="colorPrimary">#7C3AED</item>
|
||||
<item name="colorPrimaryVariant">#6D28D9</item>
|
||||
<item name="colorOnPrimary">#FFFFFF</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/reward_yellow</item>
|
||||
<item name="colorSecondaryVariant">@color/reward_yellow</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<item name="colorSecondary">#FACC15</item>
|
||||
<item name="colorSecondaryVariant">#FACC15</item>
|
||||
<item name="colorOnSecondary">#11181C</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">@color/background_light</item>
|
||||
<item name="android:statusBarColor">#F9FAFB</item>
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:windowBackground">@color/background_light</item>
|
||||
<item name="android:windowBackground">#F9FAFB</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user