This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
getMenuInflater().inflate(R.menu.menu_main, menu); | |
return super.onCreateOptionsMenu(menu); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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:id="@+id/txt_name" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<android.support.design.widget.TextInputLayout | |
android:id="@+id/input_name" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_below="@+id/toolbar"> | |
<EditText | |
android:id="@+id/name" | |
android:layout_width="match_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListView | |
android:id="@+id/list_data" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:layout_below="@+id/input_email"> | |
</ListView> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<ProgressBar | |
android:id="@+id/circular_progress" | |
android:visibility="invisible" | |
android:layout_centerInParent="true" | |
android:theme="@style/CircularProgress" | |
style="@style/Widget.AppCompat.ProgressBar" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" /> | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User { | |
String uid, name, email; | |
public User() { | |
} | |
public User(String uid, String name, String email) { | |
this.uid = uid; | |
this.name = name; | |
this.email = email; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListViewAdapter extends BaseAdapter { | |
Activity activity; | |
List<User> listUsers; | |
LayoutInflater inflater; | |
public ListViewAdapter(Activity activity, List<User> listUsers) { | |
this.activity = activity; | |
this.listUsers = listUsers; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
EditText input_name, input_email; | |
private ListView list_data; | |
private ProgressBar circular_progress; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private FirebaseDatabase mFirebaseDatabase; | |
private DatabaseReference mDatabaseReference; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... | |
//Firebase | |
initFirebase(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
//добавляем List, который будет хранить записи из БД | |
private List<User> list_users = new ArrayList<>(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
... | |
//Firebase |