-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
433 additions
and
421 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
27 changes: 27 additions & 0 deletions
27
app/src/main/java/com/blackboxindia/PostIT/CustomViews/SquareCard.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.blackboxindia.PostIT.CustomViews; | ||
|
||
import android.content.Context; | ||
import android.support.v7.widget.CardView; | ||
import android.util.AttributeSet; | ||
|
||
|
||
public class SquareCard extends CardView { | ||
|
||
public SquareCard(Context context) { | ||
super(context); | ||
} | ||
|
||
public SquareCard(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public SquareCard(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
@Override | ||
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | ||
//noinspection SuspiciousNameCombination | ||
super.onMeasure(widthMeasureSpec, widthMeasureSpec); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,13 @@ | |
import android.os.Bundle; | ||
import android.support.annotation.Nullable; | ||
import android.support.v7.widget.CardView; | ||
import android.util.Log; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
|
||
import com.blackboxindia.PostIT.R; | ||
import com.blackboxindia.PostIT.activities.MainActivity; | ||
import com.blackboxindia.PostIT.dataModels.AdTypes; | ||
import com.blackboxindia.PostIT.dataModels.UserInfo; | ||
|
||
public class Frag_Main extends Fragment { | ||
|
||
|
@@ -105,22 +103,6 @@ public void onClick(View v) { | |
mainActivity.launchOtherFragment(new Frag_Docs(),MainActivity.DOCS_TAG, true); | ||
} | ||
else { | ||
// mainActivity.createSnackbar("Please Login to view Documents", Snackbar.LENGTH_INDEFINITE, true, "Login", new View.OnClickListener() { | ||
// @Override | ||
// public void onClick(View v) { | ||
// ((MainActivity)context).launchOtherFragment(new Frag_LoginPage(),MainActivity.LOGIN_PAGE_TAG, true); | ||
// } | ||
// }); | ||
UserInfo userInfo = new UserInfo(); | ||
userInfo.setCollegeName("IIT Indore"); | ||
userInfo.setName("Anonymous"); | ||
userInfo.setEmail("[email protected]"); | ||
userInfo.setHostel(""); | ||
userInfo.setuID(""); | ||
userInfo.setPhone(""); | ||
userInfo.setRoomNumber(""); | ||
userInfo.setHasProfileIMG(false); | ||
((MainActivity)context).AnonLogin(userInfo); | ||
mainActivity.launchOtherFragment(new Frag_Docs(),MainActivity.DOCS_TAG, true); | ||
} | ||
|
||
|
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/blackboxindia/PostIT/Network/ConnectionDetector.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.blackboxindia.PostIT.Network; | ||
|
||
import android.content.Context; | ||
import android.net.ConnectivityManager; | ||
import android.net.NetworkInfo; | ||
|
||
public class ConnectionDetector { | ||
public static boolean isNetworkAvailable(Context context) { | ||
ConnectivityManager connectivityManager | ||
= (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | ||
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); | ||
|
||
return activeNetworkInfo != null && activeNetworkInfo.isConnected(); | ||
} | ||
} |
Oops, something went wrong.