jatotko Goto Github PK
Name: xoxjakobxox
Type: User
Name: xoxjakobxox
Type: User
Check your project for common sources of contributor friction.
A web based git repository browser written in PHP
src/de/robv/android/xposed/installer/DownloadDetailsActivity.java package de.robv.android.xposed.installer; import java.util.List; import android.app.Fragment; import android.app.FragmentManager; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v13.app.FragmentStatePagerAdapter; import android.support.v4.view.ViewPager; import android.text.TextUtils; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.TextView; import de.robv.android.xposed.installer.repo.Module; import de.robv.android.xposed.installer.util.ModuleUtil; import de.robv.android.xposed.installer.util.ModuleUtil.InstalledModule; import de.robv.android.xposed.installer.util.ModuleUtil.ModuleListener; import de.robv.android.xposed.installer.util.RepoLoader; import de.robv.android.xposed.installer.util.RepoLoader.RepoListener; public class DownloadDetailsActivity extends XposedDropdownNavActivity implements RepoListener, ModuleListener { private ViewPager mPager; private String[] mPageTitles; private String mPackageName; private static RepoLoader sRepoLoader = RepoLoader.getInstance(); private static ModuleUtil sModuleUtil = ModuleUtil.getInstance(); private Module mModule; private InstalledModule mInstalledModule; public static final int DOWNLOAD_DESCRIPTION = 0; public static final int DOWNLOAD_VERSIONS = 1; public static final int DOWNLOAD_SETTINGS = 2; @Override public void onCreate(Bundle savedInstanceState) { mPackageName = getModulePackageName(); mModule = sRepoLoader.getModule(mPackageName); mInstalledModule = ModuleUtil.getInstance().getModule(mPackageName); super.onCreate(savedInstanceState); sRepoLoader.addListener(this, false); sModuleUtil.addListener(this); setNavItem(XposedDropdownNavActivity.TAB_DOWNLOAD); if (mModule != null) { setContentView(R.layout.activity_download_details); ((TextView) findViewById(android.R.id.title)).setText(mModule.name); mPageTitles = new String[] { getString(R.string.download_details_page_description), getString(R.string.download_details_page_versions), getString(R.string.download_details_page_settings), }; mPager = (ViewPager) findViewById(R.id.download_pager); mPager.setAdapter(new ScreenSlidePagerAdapter(getFragmentManager())); // Updates available => start on the versions page if (mInstalledModule != null && mInstalledModule.isUpdate(sRepoLoader.getLatestVersion(mModule))) mPager.setCurrentItem(DOWNLOAD_VERSIONS); } else { setContentView(R.layout.activity_download_details_not_found); TextView txtMessage = (TextView) findViewById(android.R.id.message); txtMessage.setText(getResources().getString(R.string.download_details_not_found, mPackageName)); findViewById(R.id.reload).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { v.setEnabled(false); sRepoLoader.triggerReload(true); } }); } } private String getModulePackageName() { Uri uri = getIntent().getData(); if (uri == null) return null; String scheme = uri.getScheme(); if (TextUtils.isEmpty(scheme)) { return null; } else if (scheme.equals("package")) { return uri.getSchemeSpecificPart(); } else if (scheme.equals("http")) { List<String> segments = uri.getPathSegments(); if (segments.size() > 1) return segments.get(1); } return null; } @Override protected void onDestroy() { super.onDestroy(); sRepoLoader.removeListener(this); sModuleUtil.removeListener(this); } public Module getModule() { return mModule; } public InstalledModule getInstalledModule() { return mInstalledModule; } public void gotoPage(int page) { mPager.setCurrentItem(page); } private void reload() { runOnUiThread(new Runnable() { @Override public void run() { recreate(); } }); } @Override public void onRepoReloaded(RepoLoader loader) { reload(); } @Override public void onInstalledModulesReloaded(ModuleUtil moduleUtil) { reload(); } @Override public void onSingleInstalledModuleReloaded(ModuleUtil moduleUtil, String packageName, InstalledModule module) { if (packageName.equals(mPackageName)) reload(); } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_download_details, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_refresh: RepoLoader.getInstance().triggerReload(true); return true; } return super.onOptionsItemSelected(item); } @Override protected boolean navigateViaIntent() { return true; } @Override protected Intent getParentIntent() { Intent intent = new Intent(this, XposedInstallerActivity.class); intent.putExtra(XposedInstallerActivity.EXTRA_SECTION, TAB_DOWNLOAD); return intent; } private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter { public ScreenSlidePagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { switch (position) { case DOWNLOAD_DESCRIPTION: return new DownloadDetailsFragment(); case DOWNLOAD_VERSIONS: return new DownloadDetailsVersionsFragment(); case DOWNLOAD_SETTINGS: return new DownloadDetailsSettingsFragment(); default: return null; } } @Override public int getCount() { return mPageTitles.length; } @Override public CharSequence getPageTitle(int position) { return mPageTitles[position]; } } } Desktop version
/** * Created with JetBrains WebStorm * Date: 6/20/13 * Copyright 2013 Brandon Xavier This file is part of CB-AppDevKit. CB-AppDevKit is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CB-AppDevKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CB-AppDevKit. If not, see <http://www.gnu.org/licenses/>. */ var AppDevKit = true; var ADK = {'readyToRun': false, 'scriptName': "", 'initFunction': "", 'settingsChoices':
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.