Skip to content

Instantly share code, notes, and snippets.

@DoruAdryan
Created October 20, 2014 15:54
Show Gist options
  • Save DoruAdryan/386c93b8465313a878b0 to your computer and use it in GitHub Desktop.
Save DoruAdryan/386c93b8465313a878b0 to your computer and use it in GitHub Desktop.
public class AnActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.act_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container_list, new PlaceHolderListFragment())
.commit();
}
}
static class PlaceHolderListFragment extends ListFragment {
String[] testStrings = new String[] { "a\na", "a\na", "a\na", "a\na",
"a\na", "a\na", "a\na", "a\na", "a\na", "a\na", "a\na", "a\na" };
String htmlTestContent = "<span style=\"font-weight: light; color: #5c5c5c; font-size: 17px; line-height: 24px;\"><p></p>\n<p>Trading247 was established in 2013 and has been targeting the lucrative Asian market, focusing their efforts on Australian, Chinese and Japanese traders. To fully cover the interests of local traders the broker has on offer a long list of stocks including some of the largest companies in the region like ANZ Bank, Lynas Corporation, Newcrest Mining and Baidu among others.</p>\n<p>Their indices also span across the Asia-Pacific region without skipping on the entries from Europe and the US. The commodities on offer are rather sparse and the pairs are lower in number compared to many other brokers, but are probably selected to reflect the preference of the traders.</p>\n<p>We have the usual option types on offer - high/low, one touch and 60 seconds. Payouts for binaries vary between 70% for less traded instruments and 85% for the most popular currency pairs.</p>\n<p>For one touch the payouts are between 480% and 540%, mainly offered for the most popular US stocks and indices. For the 60 seconds the payout starts from 61% and reaches 70%. There is also an Option Builder with customizable expiry time and profit/loss control.</p>\n<p>The site also offers the \"Buy Me Out\" functionality, which is used in volatile markets to exit a position either already in some profit or limit losses from a sharp downward move. This can be accessed from the ProTrader tab in the platform.</p>\n<p>In an interview, the company's founder and CEO Rob Payne</a> has explained that Trading247 struck a strategic partnership in the region with its platform provider, Spotoption. The aspiration to cater to regional clientele is fulfilled by the company's decision to locate its initial support base center in Australia, \"a great multi-cultural country with fantastic service-oriented people.\"</p>\n</span>";
public PlaceHolderListFragment() {
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
getActivity(), android.R.layout.simple_list_item_1,
android.R.id.text1, testStrings);
View header = LayoutInflater.from(getActivity()).inflate(
R.layout.frag_header, getListView(), false);
((WebView) header.findViewById(R.id.wv_test)).loadDataWithBaseURL(
"http://fake.com", htmlTestContent, "text/html",
"charset=UTF-8", null);
getListView().addHeaderView(header);
setListAdapter(adapter);
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment