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
import java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
import java.io.PrintWriter; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
public class SocketConnection { |
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
/** | |
* Sets ListView height dynamically based on the height of the items. | |
* | |
* @param listView to be resized | |
* @return true if the listView is successfully resized, false otherwise | |
*/ | |
public static boolean setListViewHeightBasedOnItems(ListView listView) { | |
ListAdapter listAdapter = listView.getAdapter(); | |
if (listAdapter != null) { | |
int numberOfItems = listAdapter.getCount(); |
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
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; | |
import android.widget.TextView; | |
import java.util.ArrayList; | |
public class AdapterHorizontalList extends RecyclerView.Adapter<AdapterHorizontalList.ViewHolder> { |