Skip to content

Commit

Permalink
Removed log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
DanWlker committed Jan 5, 2022
1 parent 145fa87 commit f3b3766
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -109,7 +108,6 @@ public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
Log.d("Custom", "edit text changed");
search(String.valueOf(charSequence));
}

Expand All @@ -130,13 +128,11 @@ private void search(String searchTerm) {
FirebaseRecyclerOptions<CheckInLocationModal> options;

if(searchTerm.equals("")) {
Log.d("Custom", "Search term is empty");
options = new FirebaseRecyclerOptions.Builder<CheckInLocationModal>()
.setIndexedQuery(mbase.orderByKey().limitToLast(20), mbase.getRef(), CheckInLocationModal.class)
//.setQuery(mbase, CheckInLocationModal.class)
.build();
} else {
Log.d("Custom", "Search term is: " + searchTerm);
options = new FirebaseRecyclerOptions.Builder<CheckInLocationModal>()
.setIndexedQuery(mbase.orderByKey()
.startAt(searchTerm)
Expand All @@ -145,7 +141,6 @@ private void search(String searchTerm) {
//.setQuery(mbase, CheckInLocationModal.class)
.build();
}
Log.d("Custom", "Setting adapter");
//Firebase stuff
adapter = new CheckInLocationAdapter(options);
recyclerView.setAdapter(adapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import android.os.Bundle;
import android.os.Handler;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
Expand Down Expand Up @@ -169,16 +168,10 @@ private void createUserInFirebase() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()) {
// Sign in is successful
Log.d("Firebase", "createUserWithEmail: Success");

// Create user in realtime database and save data in it
Log.d("Firebase", "Saving user info in database");

saveUserInfoInFirebase();
} else {
//Sign in is unsuccessful
Log.w("Firebase", "createUserWithEmail: Fail", task.getException());
Toast.makeText(ICVerification.this, "Authentication failed.", Toast.LENGTH_SHORT).show();
}
}
Expand Down
5 changes: 2 additions & 3 deletions app/src/main/java/com/example/myctrace/ui/login/Login.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
Expand Down Expand Up @@ -144,11 +143,11 @@ private void loginUsingFirebase() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful()) {
Log.d("Firebase", "Login successful");

//redirect to home
redirectToHome();
} else {
Log.d("Firebase", "Login failed");

Toast.makeText(Login.this, "Failed to login! Please retry again.", Toast.LENGTH_LONG).show();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,6 @@ private void generateQR(String str) {
//the function returns a bitmap
qrBitmap = encoder.encodeAsBitmap();
} catch (WriterException e) {
Log.e("Encoder", e.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ private void redirectToLogin() {

private boolean checkFields(Map<String, String> input) {
for(String value: input.values()) {
Log.d("checkfields",value);
if(value.isEmpty()) {
Toast.makeText(this, "Please fill in all fields.", Toast.LENGTH_LONG).show();
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -83,7 +82,7 @@ public boolean onKey(View view, int i, KeyEvent keyEvent) {
// If the event is a key-down event on the "enter" button
if ((keyEvent.getAction() == KeyEvent.ACTION_DOWN) &&
(i == KeyEvent.KEYCODE_ENTER)) {
Log.d("Custom", "Enter is pressed on edit text.");

// Perform action on key press
displayResults(edTxtSearchLocation.getText().toString());
return true;
Expand All @@ -98,33 +97,33 @@ private void displayResults(String searchTerm) {

if(searchTerm.equals("") || searchTerm.isEmpty()) {
Toast.makeText(getContext(), "Please enter a location.", Toast.LENGTH_LONG);
Log.d("Custom", "Empty input");

previousResult = "";
adapter.clear();
return;
}

if(previousResult.equals(searchTerm)) {
Log.d("Custom", "Search term is same");

return;
}
previousResult = searchTerm;

ArrayList<PPVLocation> searchedLocations = new ArrayList<PPVLocation>();
Log.d("Custom", "Adding to searched Locations");

for(PPVLocation location : allLocations) {
if(location.st.equals(searchTerm) || location.dist.equals(searchTerm)) {
searchedLocations.add(location);
}
}

if(searchedLocations.size() <= 0) {
Log.d("Custom", "No results");

Toast.makeText(getContext(), "No results", Toast.LENGTH_LONG).show();
return;
}

Log.d("Custom", "Adding to adapter");

adapter.clear();
adapter.addAll(searchedLocations);

Expand All @@ -151,7 +150,7 @@ private void fetchData() {
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
//Log.d("Custom", response);

try {
JSONObject topLevel = new JSONObject(response.substring(response.indexOf("{"), response.lastIndexOf("}") + 1));
JSONArray jArr = topLevel.getJSONArray("data");
Expand All @@ -164,10 +163,10 @@ public void onResponse(String response) {
allLocations.add(tempObj);
}
} catch (JSONException e) {
Log.d("Custom", e.toString());

}
nDialog.dismiss();
Log.d("Custom", "Created all json objects");


listViewPPVHolder = getView().findViewById(R.id.listViewPPVHolder);
adapter = new PPVLocationAdapter(getContext(), locations);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -37,7 +36,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
TextView txtViewState = (TextView) convertView.findViewById(R.id.txtViewState);

// Populate the data into the template view using the data object
Log.d("Custom", "Populating view");

txtViewLocation.setText(ppvLocation.ppvc);
txtViewDestination.setText(ppvLocation.dist);
txtViewState.setText(ppvLocation.st);
Expand Down

0 comments on commit f3b3766

Please sign in to comment.