コード例 #1
0
  // Click Item View Content
  public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

    arrayItemAdapter.setSelectItem(position);
    arrayItemAdapter.notifyDataSetChanged();

    listViewIndex = localViewList.getFirstVisiblePosition();
    View v2 = localViewList.getChildAt(0);
    listViewTop = (v2 == null) ? 0 : v2.getTop();
    log.debug("OnItemClick:listViewIndex[" + listViewIndex + "]listViewTop[" + listViewTop + "]");

    Item item = mDbFeedAdapter.getItem(id);
    if ("".equals(Utils.isNull(item.getFeedType()))) {
      item.setFeedType(feedType);
    }
    log.debug("FeedType:" + item.getFeedType());

    Feed currentFeed = mDbFeedAdapter.getFeedNoItem(item.getFeedId(), feedType); // new Feed();
    // currentFeed.setType(feedType);
    // currentFeed.setTitle(feedTitle);
    new StartNewActivityInThread(
            dialog, currentFeed, item, topicCurPage, listViewIndex, listViewTop)
        .run();
  }
コード例 #2
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Load Phone Preperty
    phoneProperty = new PhoneProperty(this);

    // log.debug("FeedMainItemLocalActivity:OnCreate");

    // Load Setting
    SharedPreferencesHelper settingS = new SharedPreferencesHelper(this);
    currentFontSize = settingS.getSetting("textSize", "18");
    userName = Utils.isNull(settingS.getSetting("username", ""));
    password = Utils.isNull(settingS.getSetting("password", ""));

    // log.debug("currentFontSize:"+currentFontSize);
    // log.debug("userName:["+userName+"]");
    // log.debug("password:["+password+"]");

    /** Set Custom Title Bar * */
    customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    setContentView(R.layout.swipe_main_item_layout);

    Bundle extras = getIntent().getExtras(); // Case Pass Param From Another Activity
    if (extras != null) {
      feedTitle = Utils.isNull(extras.getString("FEED_TITLE"));
      feedType = Utils.isNull(extras.getString("FEED_TYPE"));
      topicCurPage = extras.getInt("TOPIC_CUR_PAGE");

      appConfig = (AppConfig) extras.get("APP_CONFIG_MAP");
      listViewIndex = extras.getInt("listViewIndex");
      listViewTop = extras.getInt("listViewTop");

      // log.debug("feedType["+feedType+"]");
      // log.debug("feedTitle["+feedTitle+"]");
      customTitleBar(feedTitle);
    }
    String[] names = new String[1];
    if (Constants.FEED_TYPE_BORAD.equalsIgnoreCase(feedType)) {
      names[0] = "MyBookmark";
    } else {
      names[0] = "MyLocal";
    }

    viewFlow = (ExtViewFlow) findViewById(R.id.viewflow);
    adapter = new ExtDiffItemLocalViewAdapter(this, names);
    viewFlow.setAdapter(adapter);
    ExtTitleFlowIndicator indicator = (ExtTitleFlowIndicator) findViewById(R.id.viewflowindic);
    indicator.setTitleProvider(adapter);
    viewFlow.setFlowIndicator(indicator);

    /** Open DataBase * */
    mDbFeedAdapter = new DBAdapter(this, currentFeedId, null);
    mDbFeedAdapter.open();

    /** FooterView Load more item * */
    footerView =
        ((LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE))
            .inflate(R.layout.listfooter, null, false);

    /** Set Back Button * */
    backBtn = (Button) findViewById(R.id.controlBackBtn);
    controlMoreControlBtn = (Button) findViewById(R.id.controlConfigBtn);
    controlRefreshBtn = (Button) findViewById(R.id.controlRefreshBtn);
    backBtn.setOnClickListener(this);
    controlMoreControlBtn.setOnClickListener(this);
    controlRefreshBtn.setOnClickListener(this);

    /** ********** Set Local*********************************************** */
    localViewList = (ListView) findViewById(R.id.feed_local_list);
    // register itemListener
    localViewList.setOnItemClickListener(this);
    localViewList.setOnItemLongClickListener(this);
    /** ******************************************************** */

    // Add Data to ListView
    refreshListAllView(currentDateSort);
  }